lkml.org 
[lkml]   [2005]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] sys_punchhole()
From
Date
On Fri, 2005-11-11 at 06:18 +0100, Arjan van de Ven wrote:
> On Thu, 2005-11-10 at 15:23 -0800, Badari Pulavarty wrote:
> >
> > We discussed this in madvise(REMOVE) thread - to add support
> > for sys_punchhole(fd, offset, len) to complete the functionality
> > (in the future).
>
> in the past always this was said to be "really hard" in linux locking
> wise, esp. the locking with respect to truncate...
>
> did you find a solution to this problem ?

I have been thinking about some of the race condition we might run into.
Its hard to think all of them, when I really don't have any code to play
with :(

Anyway, I think race against truncate is fine. We hold i_alloc_sem -
which should serialize against truncates. This should also serialize
against DIO. Holding i_sem should take care of writers.

One concern I can think of is, racing with read(2). While we are
thrashing pagecache and calling filesystem to free up the blocks -
a read(2) could read old disk block and give old data (since it won't
find it in pagecache). This could become a security hole :(

Thanks,
Badari

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-16 17:07    [W:0.322 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site