public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] cifs: fix revalidation test in cifs_llseek()
@ 2012-04-19 21:06 Dan Carpenter
       [not found] ` <20120419210619.GA19074-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2012-04-19 21:06 UTC (permalink / raw)
  To: Steve French; +Cc: linux-cifs, kernel-janitors, samba-technical, Josef Bacik

This test is always true so it means we revalidate the length every
time, which generates more network traffic.  This was introduced in
06222e491e "fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that
define their own llseek".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Josef, there were three other places that had this same problem but I
think they've all been fixed now.  Except that I had a question about
nfs_file_llseek().  Isn't that reversed?  It seems like it only
revalidates when it's not supposed to.  I chose to copy what
fuse_file_llseek() does instead.

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index d342128..97d26c7 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -695,7 +695,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;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-30 15:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 21:06 [patch] cifs: fix revalidation test in cifs_llseek() Dan Carpenter
     [not found] ` <20120419210619.GA19074-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2012-04-27 12:59   ` Pavel Shilovsky
     [not found]     ` <CAKywueQrrHdqXXrHQbP=vjs_MLjksvR09cpax0iWw-PS6ms=fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-27 13:20       ` Pankaj Baranwal
2012-04-27 13:40     ` Jeff Layton
2012-04-30 14:36     ` [patch v2] " Dan Carpenter
2012-04-30 15:15       ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox