diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/inode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index af422625cee6..e57e5c46ad48 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1420,11 +1420,10 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1420 | } | 1420 | } |
1421 | cifsInode = CIFS_I(direntry->d_inode); | 1421 | cifsInode = CIFS_I(direntry->d_inode); |
1422 | 1422 | ||
1423 | /* BB check if we need to refresh inode from server now ? BB */ | 1423 | if ((attrs->ia_valid & ATTR_MTIME) || (attrs->ia_valid & ATTR_SIZE)) { |
1424 | |||
1425 | if (attrs->ia_valid & ATTR_SIZE) { | ||
1426 | /* | 1424 | /* |
1427 | Flush data before changing file size on server. If the | 1425 | Flush data before changing file size or changing the last |
1426 | write time of the file on the server. If the | ||
1428 | flush returns error, store it to report later and continue. | 1427 | flush returns error, store it to report later and continue. |
1429 | BB: This should be smarter. Why bother flushing pages that | 1428 | BB: This should be smarter. Why bother flushing pages that |
1430 | will be truncated anyway? Also, should we error out here if | 1429 | will be truncated anyway? Also, should we error out here if |
@@ -1435,7 +1434,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1435 | CIFS_I(direntry->d_inode)->write_behind_rc = rc; | 1434 | CIFS_I(direntry->d_inode)->write_behind_rc = rc; |
1436 | rc = 0; | 1435 | rc = 0; |
1437 | } | 1436 | } |
1437 | } | ||
1438 | 1438 | ||
1439 | if (attrs->ia_valid & ATTR_SIZE) { | ||
1439 | /* To avoid spurious oplock breaks from server, in the case of | 1440 | /* To avoid spurious oplock breaks from server, in the case of |
1440 | inodes that we already have open, avoid doing path based | 1441 | inodes that we already have open, avoid doing path based |
1441 | setting of file size if we can do it by handle. | 1442 | setting of file size if we can do it by handle. |