summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-12-15 18:38:10 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-12-15 18:44:36 -0500
commit6c52961743f38747401b47127b82159ab6d8a7a4 (patch)
treecfc3ba22db14f6402e567b70cad424ffd43545a6 /fs
parent652f89f64fabcdae9143ee2b4253cfa838fb0279 (diff)
downloadlinux-3.10-6c52961743f38747401b47127b82159ab6d8a7a4.tar.gz
linux-3.10-6c52961743f38747401b47127b82159ab6d8a7a4.tar.bz2
linux-3.10-6c52961743f38747401b47127b82159ab6d8a7a4.zip
NFS: Fix a regression in nfs_file_llseek()
After commit 06222e491e663dac939f04b125c9dc52126a75c4 (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]
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index eca56d4b39c..606ef0f20ae 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);