cifs: fix revalidation test in cifs_llseek()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 30 Apr 2012 14:36:21 +0000 (17:36 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:43:54 +0000 (00:43 +0100)
commit 48a5730e5b71201e226ff06e245bf308feba5f10 upstream.

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 <dan.carpenter@oracle.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/cifsfs.c

index b4c2c99..b1451af 100644 (file)
@@ -703,7 +703,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;