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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 Dec 2011 18:39:13 -0500
From:	Trond Myklebust <Trond.Myklebust@...app.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	roel <roel.kluin@...il.com>, LKML <linux-kernel@...r.kernel.org>,
	sage@...dream.net, Steve French <sfrench@...ba.org>,
	linux-cifs@...r.kernel.org, Miklos Szeredi <miklos@...redi.hu>,
	fuse-devel@...ts.sourceforge.net, linux-nfs@...r.kernel.org
Subject: Re: ceph, cifs, nfs, fuse: boolean and / or confusion

On Mon, 2011-12-12 at 15:28 -0800, Andrew Morton wrote: 
> On Tue, 13 Dec 2011 00:06:36 +0100
> roel <roel.kluin@...il.com> wrote:
> 
> > The test not SEEK_CUR or not SEEK_SET always evaluates to true
> > 
> > Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> > ---
> >  fs/ceph/file.c   |    2 +-
> >  fs/cifs/cifsfs.c |    2 +-
> >  fs/fuse/file.c   |    2 +-
> >  fs/nfs/file.c    |    2 +-
> >  4 files changed, 4 insertions(+), 4 deletions(-)
> > 
<snip> 
> > diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> > index eca56d4..606ef0f 100644
> > --- a/fs/nfs/file.c
> > +++ b/fs/nfs/file.c
> > @@ -147,7 +147,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
> >  	 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
> >  	 * the cached file length
> >  	 */
> > -	if (origin != SEEK_SET || origin != SEEK_CUR) {
> > +	if (origin != SEEK_SET && origin != SEEK_CUR) {
> >  		struct inode *inode = filp->f_mapping->host;
> >  
> >  		int retval = nfs_revalidate_file_size(inode, filp);
> 
> This fix will cause changed runtime behaviour, such as NFS no longer
> running nfs_revalidate_file_size() for all seek modes.

As far as NFS is concerned, it reverts a regression. NFS only used to
run revalidate_file_size() for SEEK_END prior to commit
06222e491e663dac939f04b125c9dc52126a75c4. I accept that we now also need
to run it for SEEK_HOLE and SEEK_DATA, but we've never had to do so for
SEEK_SET and SEEK_CUR.

I suspect the same is true of ceph, cifs etc...

Cheers
  Trond

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@...app.com
www.netapp.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