Commit a59c449b authored by Alan Tyson's avatar Alan Tyson Committed by Greg Kroah-Hartman

CIFS: reset mode when client notices that ATTR_READONLY is no longer set

[CIFS] reset mode when client notices that ATTR_READONLY is no longer set

[<cebbert@redhat.com>: removed changelog part of patch]

Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: default avatarAlan Tyso <atyson@hp.com>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e21c656f
...@@ -488,6 +488,12 @@ int cifs_get_inode_info(struct inode **pinode, ...@@ -488,6 +488,12 @@ int cifs_get_inode_info(struct inode **pinode,
mode e.g. 555 */ mode e.g. 555 */
if (cifsInfo->cifsAttrs & ATTR_READONLY) if (cifsInfo->cifsAttrs & ATTR_READONLY)
inode->i_mode &= ~(S_IWUGO); 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 - /* BB add code here -
validate if device or weird share or device type? */ validate if device or weird share or device type? */
} }
......
...@@ -215,6 +215,10 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, ...@@ -215,6 +215,10 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
tmp_inode->i_mode |= S_IFREG; tmp_inode->i_mode |= S_IFREG;
if (attr & ATTR_READONLY) if (attr & ATTR_READONLY)
tmp_inode->i_mode &= ~(S_IWUGO); 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? */ } /* 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 */ /* can not fill in nlink here as in qpathinfo version and Unx search */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment