Skip to content

Commit 6c52961

Browse files
Trond MyklebustTrond Myklebust
Trond Myklebust
authored and
Trond Myklebust
committed
NFS: Fix a regression in nfs_file_llseek()
After commit 06222e4 (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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> Cc: [email protected] [>=3.1]
1 parent 652f89f commit 6c52961

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
147147
* origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
148148
* the cached file length
149149
*/
150-
if (origin != SEEK_SET || origin != SEEK_CUR) {
150+
if (origin != SEEK_SET && origin != SEEK_CUR) {
151151
struct inode *inode = filp->f_mapping->host;
152152

153153
int retval = nfs_revalidate_file_size(inode, filp);

0 commit comments

Comments
 (0)