lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100504230758.GD8120@dastard>
Date:	Wed, 5 May 2010 09:07:58 +1000
From:	Dave Chinner <david@...morbit.com>
To:	Josef Bacik <josef@...hat.com>
Cc:	linux-btrfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...r.kernel.org
Subject: Re: [PATCH 1/3] fs: allow short direct-io reads to be completed
 via buffered IO

On Tue, May 04, 2010 at 11:27:50AM -0400, Josef Bacik wrote:
> 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,

Yes, that looks like it would work to me. Might be worth a comment,
though.

Cheers,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ