From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Date: Mon, 30 Apr 2012 15:15:14 +0000 Subject: Re: [patch v2] cifs: fix revalidation test in cifs_llseek() Message-Id: <20120430111514.72b54efa@corrin.poochiereds.net> List-Id: References: <20120419210619.GA19074@elgon.mountain> <20120430143621.GK6447@mwanda> In-Reply-To: <20120430143621.GK6447@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Pavel Shilovsky , Steve French , linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org, Josef Bacik On Mon, 30 Apr 2012 17:36:21 +0300 Dan Carpenter wrote: > This test is always true so it means we revalidate the length every > time, which generates more network traffic. When it is SEEK_SET or > SEEK_CUR, then we don't need to revalidate. > > Signed-off-by: Dan Carpenter > --- > v2: I had the test reversed in the first version. > > diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c > index 811245b..4a6ad20 100644 > --- a/fs/cifs/cifsfs.c > +++ b/fs/cifs/cifsfs.c > @@ -699,7 +699,7 @@ static loff_t cifs_llseek(struct file *file, 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) { > int rc; > struct inode *inode = file->f_path.dentry->d_inode; > Looks good. Reviewed-by: Jeff Layton