diff options
-rw-r--r-- | fs/cifs/connect.c | 2 | ||||
-rw-r--r-- | fs/cifs/inode.c | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 6b520aad7af3..965050867599 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1339,7 +1339,7 @@ cifs_find_tcp_session(struct in_addr *target_ip_addr, | |||
1339 | memcmp(&ses->server->addr.sockAddr6.sin6_addr, | 1339 | memcmp(&ses->server->addr.sockAddr6.sin6_addr, |
1340 | target_ip6_addr, sizeof(*target_ip6_addr))) | 1340 | target_ip6_addr, sizeof(*target_ip6_addr))) |
1341 | continue; | 1341 | continue; |
1342 | /* BB lock server and tcp session and increment use count here?? */ | 1342 | /* BB lock server and tcp session; increment use count here?? */ |
1343 | 1343 | ||
1344 | /* found a match on the TCP session */ | 1344 | /* found a match on the TCP session */ |
1345 | *psrvTcp = ses->server; | 1345 | *psrvTcp = ses->server; |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 0d9d2e6d7af6..d904a037c833 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1408,18 +1408,19 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1408 | __u64 uid = 0xFFFFFFFFFFFFFFFFULL; | 1408 | __u64 uid = 0xFFFFFFFFFFFFFFFFULL; |
1409 | __u64 gid = 0xFFFFFFFFFFFFFFFFULL; | 1409 | __u64 gid = 0xFFFFFFFFFFFFFFFFULL; |
1410 | struct cifsInodeInfo *cifsInode; | 1410 | struct cifsInodeInfo *cifsInode; |
1411 | struct inode *inode = direntry->d_inode; | ||
1411 | 1412 | ||
1412 | xid = GetXid(); | 1413 | xid = GetXid(); |
1413 | 1414 | ||
1414 | cFYI(1, ("setattr on file %s attrs->iavalid 0x%x", | 1415 | cFYI(1, ("setattr on file %s attrs->iavalid 0x%x", |
1415 | direntry->d_name.name, attrs->ia_valid)); | 1416 | direntry->d_name.name, attrs->ia_valid)); |
1416 | 1417 | ||
1417 | cifs_sb = CIFS_SB(direntry->d_inode->i_sb); | 1418 | cifs_sb = CIFS_SB(inode->i_sb); |
1418 | pTcon = cifs_sb->tcon; | 1419 | pTcon = cifs_sb->tcon; |
1419 | 1420 | ||
1420 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) { | 1421 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) { |
1421 | /* check if we have permission to change attrs */ | 1422 | /* check if we have permission to change attrs */ |
1422 | rc = inode_change_ok(direntry->d_inode, attrs); | 1423 | rc = inode_change_ok(inode, attrs); |
1423 | if (rc < 0) { | 1424 | if (rc < 0) { |
1424 | FreeXid(xid); | 1425 | FreeXid(xid); |
1425 | return rc; | 1426 | return rc; |
@@ -1432,7 +1433,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1432 | FreeXid(xid); | 1433 | FreeXid(xid); |
1433 | return -ENOMEM; | 1434 | return -ENOMEM; |
1434 | } | 1435 | } |
1435 | cifsInode = CIFS_I(direntry->d_inode); | 1436 | cifsInode = CIFS_I(inode); |
1436 | 1437 | ||
1437 | if ((attrs->ia_valid & ATTR_MTIME) || (attrs->ia_valid & ATTR_SIZE)) { | 1438 | if ((attrs->ia_valid & ATTR_MTIME) || (attrs->ia_valid & ATTR_SIZE)) { |
1438 | /* | 1439 | /* |
@@ -1443,9 +1444,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1443 | will be truncated anyway? Also, should we error out here if | 1444 | will be truncated anyway? Also, should we error out here if |
1444 | the flush returns error? | 1445 | the flush returns error? |
1445 | */ | 1446 | */ |
1446 | rc = filemap_write_and_wait(direntry->d_inode->i_mapping); | 1447 | rc = filemap_write_and_wait(inode->i_mapping); |
1447 | if (rc != 0) { | 1448 | if (rc != 0) { |
1448 | CIFS_I(direntry->d_inode)->write_behind_rc = rc; | 1449 | cifsInode->write_behind_rc = rc; |
1449 | rc = 0; | 1450 | rc = 0; |
1450 | } | 1451 | } |
1451 | } | 1452 | } |
@@ -1521,9 +1522,8 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1521 | */ | 1522 | */ |
1522 | 1523 | ||
1523 | if (rc == 0) { | 1524 | if (rc == 0) { |
1524 | rc = cifs_vmtruncate(direntry->d_inode, attrs->ia_size); | 1525 | rc = cifs_vmtruncate(inode, attrs->ia_size); |
1525 | cifs_truncate_page(direntry->d_inode->i_mapping, | 1526 | cifs_truncate_page(inode->i_mapping, inode->i_size); |
1526 | direntry->d_inode->i_size); | ||
1527 | } else | 1527 | } else |
1528 | goto cifs_setattr_exit; | 1528 | goto cifs_setattr_exit; |
1529 | } | 1529 | } |
@@ -1557,7 +1557,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1557 | rc = 0; | 1557 | rc = 0; |
1558 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 1558 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
1559 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) | 1559 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) |
1560 | rc = mode_to_acl(direntry->d_inode, full_path, mode); | 1560 | rc = mode_to_acl(inode, full_path, mode); |
1561 | else if ((mode & S_IWUGO) == 0) { | 1561 | else if ((mode & S_IWUGO) == 0) { |
1562 | #else | 1562 | #else |
1563 | if ((mode & S_IWUGO) == 0) { | 1563 | if ((mode & S_IWUGO) == 0) { |
@@ -1665,7 +1665,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1665 | /* do not need local check to inode_check_ok since the server does | 1665 | /* do not need local check to inode_check_ok since the server does |
1666 | that */ | 1666 | that */ |
1667 | if (!rc) | 1667 | if (!rc) |
1668 | rc = inode_setattr(direntry->d_inode, attrs); | 1668 | rc = inode_setattr(inode, attrs); |
1669 | cifs_setattr_exit: | 1669 | cifs_setattr_exit: |
1670 | kfree(full_path); | 1670 | kfree(full_path); |
1671 | FreeXid(xid); | 1671 | FreeXid(xid); |