commit f5c1e2ea71603bc2962041fef9dd902cb8626a1d
Author: Alan Tyson <[EMAIL PROTECTED]>
Date:   Sat Mar 10 06:05:14 2007 +0000

    [CIFS] reset mode when client notices that ATTR_READONLY is no longer set
    
    Signed-off-by: Alan Tyso <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 
6247628bdaed896cf09485c2a50f66edb5c40d5b..1cbe5615993c527bf1dc99f2e8b94d485471fbe0
 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -4,6 +4,9 @@ Fix mtime bouncing around from local ide
 Fix hang (in i_size_read) when simultaneous size update of same remote file
 on smp system corrupts sequence number. Do not reread unnecessarily partial 
page
 (which we are about to overwrite anyway) when writing out file opened rw.
+When DOS attribute of file on non-Unix server's file changes on the server side
+from read-only back to read-write, reflect this change in default file mode
+(we had been leaving a file's mode read-only until the inode were reloaded)
 
 Version 1.47
 ------------
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 
86b9dbbd8441b487c7f496bc95394cf8494845ba..e75a844accd7b5d58060d4d2159730a7650dac96
 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -494,6 +494,12 @@ int cifs_get_inode_info(struct inode **p
                           mode e.g. 555 */
                        if (cifsInfo->cifsAttrs & ATTR_READONLY)
                                inode->i_mode &= ~(S_IWUGO);
+                       else if ((inode->i_mode & S_IWUGO) == 0)
+                               /* the ATTR_READONLY flag may have been */
+                               /* changed on server -- set any w bits  */
+                               /* allowed by mnt_file_mode             */
+                               inode->i_mode |= (S_IWUGO &
+                                                 cifs_sb->mnt_file_mode);
                /* BB add code here -
                   validate if device or weird share or device type? */
                }
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 
44cfb528797d73548fc8df8ac12eeb4a27063653..2a374d5215ab99c579ad67da11c1b6b2776462c3
 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -219,6 +219,10 @@ static void fill_in_inode(struct inode *
                tmp_inode->i_mode |= S_IFREG;
                if (attr & ATTR_READONLY)
                        tmp_inode->i_mode &= ~(S_IWUGO);
+               else if ((tmp_inode->i_mode & S_IWUGO) == 0)
+                       /* the ATTR_READONLY flag may have been changed on   */
+                       /* server -- set any w bits allowed by mnt_file_mode */
+                       tmp_inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode);
        } /* could add code here - to validate if device or weird share type? */
 
        /* can not fill in nlink here as in qpathinfo version and Unx search */
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[EMAIL PROTECTED]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to