Re: [patch 2/5] fs: introduce new aops and infrastructure

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitriy Monakhov
Date: Wednesday, March 14, 2007 - 2:28 pm

Nick Piggin <npiggin@suse.de> writes:

If prepare_write succeed we return with locked and getted page, let's remember it as [1]
What about AOP_TRUNCATED_PAGE?  Off corse we can't just "goto retry" here :) ,
but we may return it to caller and let's caller handle it.  
if ->commit_write return non negative value we return with sill locked page  look above at [1] 
may be it will be unlocked by caller? I guess no it was just forgoten.
WOW caller forgot unlock page too see above at [1].
<<<<OOPS why you new block wasn't fully zeroed? as it was done before.
At least this result in information leak in case of (stat == from)
just imagine fs with blocksize == 1k conains file with i_size == 4096 and 
fist two blocks not mapped (hole), now invoke write op from 1023 to 2048.
For example we succeed in allocating first block, but faile while allocating second
, then we call page_zero_new_buffers(...from == 1023, to == 2048)
  and then zerro only one last byte for first block, and set is uptodate
After this we just do read( from == 0, to == 1023) and steal old block content.
 
<<<<<< BTW: do_lo_send_aops() code itself is realy ugly, for example patrial 
             write not supported. 
Ohhh and now i'm totaly shure what you just forgot unlocking stuff
in pagecache_write_end()

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/5] fs: add an iovec iterator, Nick Piggin, (Wed Mar 14, 6:38 am)
[patch 2/5] fs: introduce new aops and infrastructure, Nick Piggin, (Wed Mar 14, 6:38 am)
[patch 3/5] fs: convert some simple filesystems, Nick Piggin, (Wed Mar 14, 6:38 am)
[patch 4/5] ext2: convert to new aops, Nick Piggin, (Wed Mar 14, 6:38 am)
[patch 5/5] ext3: convert to new aops, Nick Piggin, (Wed Mar 14, 6:38 am)
Re: [patch 1/5] fs: add an iovec iterator, Nick Piggin, (Wed Mar 14, 6:51 am)
Re: [patch 2/5] fs: introduce new aops and infrastructure, Dmitriy Monakhov, (Wed Mar 14, 2:28 pm)
Re: [patch 2/5] fs: introduce new aops and infrastructure, Dmitriy Monakhov, (Thu Mar 15, 2:44 am)
Re: [patch 2/5] fs: introduce new aops and infrastructure, Steven Whitehouse, (Thu Mar 15, 9:24 am)
Re: [patch 2/5] fs: introduce new aops and infrastructure, Trond Myklebust, (Thu Mar 15, 1:06 pm)