[patch v2] cifs: fix revalidation test in cifs_llseek()
Dan Carpenter
dan.carpenter at oracle.com
Mon Apr 30 08:36:21 MDT 2012
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 at oracle.com>
---
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;
More information about the samba-technical
mailing list