Re: [PATCH 1/4 v2] Direct IO return value fix for holes/fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 08, 2009 at 06:13:16PM -0700, Mingming wrote:
> ext4: Direct IO return value fix for holes/fallocate
> 
> When direct IO complete, ext4 will convert unwritten extents to written,
> for
> writes over preallocated space, or holes.
> 
> ext4_direct_IO should returns the number of bytes read/write on success.
> However there is a bug that cause ext4_direct_IO returns the number of
> bytes converted to written extents, which is 0 on success. This bug
> causes
> direct IO falls back to buffered IO even on sucessful rewrites or
> preallocated space. 
> 
> Signed-off-by: Mingming Cao <cmm@xxxxxxxxxx>

I fixed up some white space issues, and rewrote the patch descriptions
as follows:

ext4: fix ext4_ext_direct_IO()'s return value after converting uninit extents

After a direct I/O request covering an uninitalized extent (i.e.,
created using the fallocate system call) or a hole in a file, ext4
will convert the uninitialized extent so it is marked as initialized
by calling ext4_convert_unwritten_extents().  This function returns
zero on success.

This return value was getting returned by ext4_direct_IO(); however
the file system's direct_IO function is supposed to return the number
of bytes read or written on a success.  By returning zero, it confused
the direct I/O code into falling back to buffered I/O unnecessarily.

Signed-off-by: Mingming Cao <cmm@xxxxxxxxxx>
Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>

Added to the patch queue.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux