]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFS: Fix a regression in nfs_file_llseek()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 15 Dec 2011 23:38:10 +0000 (18:38 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 15 Dec 2011 23:44:36 +0000 (18:44 -0500)
After commit 18925a532aea94b10d0ebf418412120497f53908 (fs: handle
SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek)
the behaviour of llseek() was changed so that it always revalidates
the file size. The bug appears to be due to a logic error in the
afore-mentioned commit, which always evaluates to 'true'.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org [>=3.1]
fs/nfs/file.c

index eca56d4b39c0ae82caf3abb117bb9ad5163ec1b3..606ef0f20aed58d7e67b33ab2696382ece03c6f5 100644 (file)
@@ -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);