Re: [PATCH 1/3] fs: allow short direct-io reads to be completed via buffered IO

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

 



On Tue, May 04, 2010 at 10:14:18AM +1000, Dave Chinner wrote:
> On Mon, May 03, 2010 at 01:27:02PM -0400, Josef Bacik wrote:
> > This is similar to what already happens in the write case.  If we have a short
> > read while doing O_DIRECT, instead of just returning, fallthrough and try to
> > read the rest via buffered IO.  BTRFS needs this because if we encounter a
> > compressed or inline extent during DIO, we need to fallback on buffered.  If the
> > extent is compressed we need to read the entire thing into memory and
> > de-compress it into the users pages.  I have tested this with fsx and everything
> > works great.  Thanks,
> 
> Won't this mean that any direct IO read that spans EOF  (i.e. get a
> short read) now attempt a buffered IO (that will fail) before returning?
> 

Hmm yeah you are right.  What would be an acceptable way to avoid this, do a

if (retval || !count || ppos >= i_size_read(inode))
	goto out;

type thing?  Thanks,

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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux