lkml.org 
[lkml]   [2001]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Filling holes in ext2
Andrew Morton wrote:

> It matters. -ac kernels handle this by clearing out the blocks
> on the error path in __block_prepare_write(). If you retest with
> -ac kernels, you should just see zeroes.

That doesn't help. The problem occurs just the same on -ac kernels.

In this case __block_prepare_write() is successful. What happens is that
if __copy_from_user() fails, the block remains mapped but not up to
date. Thus the next read access to the file fetches the garbage data off
disk, and presents it to the user.

The only definitive solutions I can see are:
1) implement an abort_write() method for every filesystem that uses
block_prepare_write()
2) redefine commit_write() to be called on failure as well as success.
3) lock the pages corresponding to the user buffer so that
__copy_from_user() cannot fail.

I like the latter option, as it removes this abort case for ext3 and
could drastically simplify GFS.

--
Adrian Cox

-
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-03-22 12:58    [W:0.054 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site