aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index e915eb1d2e66..d9567ba2960b 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -54,9 +54,9 @@ int cifs_get_inode_info_unix(struct inode **pinode,
54 MAX_TREE_SIZE + 1) + 54 MAX_TREE_SIZE + 1) +
55 strnlen(search_path, MAX_PATHCONF) + 1, 55 strnlen(search_path, MAX_PATHCONF) + 1,
56 GFP_KERNEL); 56 GFP_KERNEL);
57 if (tmp_path == NULL) { 57 if (tmp_path == NULL)
58 return -ENOMEM; 58 return -ENOMEM;
59 } 59
60 /* have to skip first of the double backslash of 60 /* have to skip first of the double backslash of
61 UNC name */ 61 UNC name */
62 strncpy(tmp_path, pTcon->treeName, MAX_TREE_SIZE); 62 strncpy(tmp_path, pTcon->treeName, MAX_TREE_SIZE);
@@ -511,7 +511,8 @@ int cifs_get_inode_info(struct inode **pinode,
511 } 511 }
512 512
513 spin_lock(&inode->i_lock); 513 spin_lock(&inode->i_lock);
514 if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) { 514 if (is_size_safe_to_change(cifsInfo,
515 le64_to_cpu(pfindData->EndOfFile))) {
515 /* can not safely shrink the file size here if the 516 /* can not safely shrink the file size here if the
516 client is writing to it due to potential races */ 517 client is writing to it due to potential races */
517 i_size_write(inode, le64_to_cpu(pfindData->EndOfFile)); 518 i_size_write(inode, le64_to_cpu(pfindData->EndOfFile));
@@ -931,7 +932,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
931 (CIFS_UNIX_POSIX_PATH_OPS_CAP & 932 (CIFS_UNIX_POSIX_PATH_OPS_CAP &
932 le64_to_cpu(pTcon->fsUnixInfo.Capability))) { 933 le64_to_cpu(pTcon->fsUnixInfo.Capability))) {
933 u32 oplock = 0; 934 u32 oplock = 0;
934 FILE_UNIX_BASIC_INFO * pInfo = 935 FILE_UNIX_BASIC_INFO *pInfo =
935 kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); 936 kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
936 if (pInfo == NULL) { 937 if (pInfo == NULL) {
937 rc = -ENOMEM; 938 rc = -ENOMEM;
@@ -1607,7 +1608,14 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1607 CIFS_MOUNT_MAP_SPECIAL_CHR); 1608 CIFS_MOUNT_MAP_SPECIAL_CHR);
1608 else if (attrs->ia_valid & ATTR_MODE) { 1609 else if (attrs->ia_valid & ATTR_MODE) {
1609 rc = 0; 1610 rc = 0;
1610 if ((mode & S_IWUGO) == 0) /* not writeable */ { 1611#ifdef CONFIG_CIFS_EXPERIMENTAL
1612 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
1613 rc = mode_to_acl(direntry->d_inode, full_path, mode);
1614 else if ((mode & S_IWUGO) == 0) {
1615#else
1616 if ((mode & S_IWUGO) == 0) {
1617#endif
1618 /* not writeable */
1611 if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) { 1619 if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
1612 set_dosattr = TRUE; 1620 set_dosattr = TRUE;
1613 time_buf.Attributes = 1621 time_buf.Attributes =
@@ -1626,10 +1634,10 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1626 if (time_buf.Attributes == 0) 1634 if (time_buf.Attributes == 0)
1627 time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL); 1635 time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL);
1628 } 1636 }
1629 /* BB to be implemented - 1637#ifdef CONFIG_CIFS_EXPERIMENTAL
1630 via Windows security descriptors or streams */ 1638 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
1631 /* CIFSSMBWinSetPerms(xid, pTcon, full_path, mode, uid, gid, 1639 mode_to_acl(direntry->d_inode, full_path, mode);
1632 cifs_sb->local_nls); */ 1640#endif
1633 } 1641 }
1634 1642
1635 if (attrs->ia_valid & ATTR_ATIME) { 1643 if (attrs->ia_valid & ATTR_ATIME) {