Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=030e9d8147491a9d2fe1b67882a3720fcf8b95f7
Commit:     030e9d8147491a9d2fe1b67882a3720fcf8b95f7
Parent:     190ff5b3a168b666925897558998b5d97fec8731
Author:     Steve French <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 1 04:27:59 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Thu Feb 1 04:27:59 2007 +0000

    [CIFS] lseek polling returned stale EOF
    
    Fixes Samba bug 4362
    
    Discovered by Jeremy Allison
    
    Clipper database polls on EOF via lseek and can get stale EOF
    when file is open on different client
    
    Signed-off-by: Jeremy Allison <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/cifsfs.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 10c9029..93ef099 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -511,7 +511,15 @@ static loff_t cifs_llseek(struct file *file, loff_t 
offset, int origin)
 {
        /* origin == SEEK_END => we must revalidate the cached file length */
        if (origin == SEEK_END) {
-               int retval = cifs_revalidate(file->f_path.dentry);
+               int retval;
+
+               /* some applications poll for the file length in this strange
+                  way so we must seek to end on non-oplocked files by
+                  setting the revalidate time to zero */
+               if(file->f_path.dentry->d_inode)                
+                       CIFS_I(file->f_path.dentry->d_inode)->time = 0;
+
+               retval = cifs_revalidate(file->f_path.dentry);
                if (retval < 0)
                        return (loff_t)retval;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to