diff options
author | Alan Tyson <atyson@hp.com> | 2007-03-10 01:05:14 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-03-10 01:05:14 -0500 |
commit | f5c1e2ea71603bc2962041fef9dd902cb8626a1d (patch) | |
tree | 506df04849d84bbc9094a878f29123bb8e342cd1 /fs | |
parent | eee8abe5de9cbd936b51db292c8d3c406b0e79e7 (diff) |
[CIFS] reset mode when client notices that ATTR_READONLY is no longer set
Signed-off-by: Alan Tyso <atyson@hp.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/CHANGES | 3 | ||||
-rw-r--r-- | fs/cifs/inode.c | 6 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 6247628bdaed..1cbe5615993c 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -4,6 +4,9 @@ Fix mtime bouncing around from local idea of last write times to remote time. | |||
4 | Fix hang (in i_size_read) when simultaneous size update of same remote file | 4 | Fix hang (in i_size_read) when simultaneous size update of same remote file |
5 | on smp system corrupts sequence number. Do not reread unnecessarily partial page | 5 | on smp system corrupts sequence number. Do not reread unnecessarily partial page |
6 | (which we are about to overwrite anyway) when writing out file opened rw. | 6 | (which we are about to overwrite anyway) when writing out file opened rw. |
7 | When DOS attribute of file on non-Unix server's file changes on the server side | ||
8 | from read-only back to read-write, reflect this change in default file mode | ||
9 | (we had been leaving a file's mode read-only until the inode were reloaded) | ||
7 | 10 | ||
8 | Version 1.47 | 11 | Version 1.47 |
9 | ------------ | 12 | ------------ |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 86b9dbbd8441..e75a844accd7 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -494,6 +494,12 @@ int cifs_get_inode_info(struct inode **pinode, | |||
494 | mode e.g. 555 */ | 494 | mode e.g. 555 */ |
495 | if (cifsInfo->cifsAttrs & ATTR_READONLY) | 495 | if (cifsInfo->cifsAttrs & ATTR_READONLY) |
496 | inode->i_mode &= ~(S_IWUGO); | 496 | inode->i_mode &= ~(S_IWUGO); |
497 | else if ((inode->i_mode & S_IWUGO) == 0) | ||
498 | /* the ATTR_READONLY flag may have been */ | ||
499 | /* changed on server -- set any w bits */ | ||
500 | /* allowed by mnt_file_mode */ | ||
501 | inode->i_mode |= (S_IWUGO & | ||
502 | cifs_sb->mnt_file_mode); | ||
497 | /* BB add code here - | 503 | /* BB add code here - |
498 | validate if device or weird share or device type? */ | 504 | validate if device or weird share or device type? */ |
499 | } | 505 | } |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 44cfb528797d..2a374d5215ab 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -219,6 +219,10 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, | |||
219 | tmp_inode->i_mode |= S_IFREG; | 219 | tmp_inode->i_mode |= S_IFREG; |
220 | if (attr & ATTR_READONLY) | 220 | if (attr & ATTR_READONLY) |
221 | tmp_inode->i_mode &= ~(S_IWUGO); | 221 | tmp_inode->i_mode &= ~(S_IWUGO); |
222 | else if ((tmp_inode->i_mode & S_IWUGO) == 0) | ||
223 | /* the ATTR_READONLY flag may have been changed on */ | ||
224 | /* server -- set any w bits allowed by mnt_file_mode */ | ||
225 | tmp_inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode); | ||
222 | } /* could add code here - to validate if device or weird share type? */ | 226 | } /* could add code here - to validate if device or weird share type? */ |
223 | 227 | ||
224 | /* can not fill in nlink here as in qpathinfo version and Unx search */ | 228 | /* can not fill in nlink here as in qpathinfo version and Unx search */ |