diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ef3a55bf86b6..28cb6e735943 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -689,8 +689,13 @@ int cifs_get_inode_info(struct inode **pinode, | |||
689 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 689 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
690 | /* fill in 0777 bits from ACL */ | 690 | /* fill in 0777 bits from ACL */ |
691 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 691 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
692 | cFYI(1, "Getting mode bits from ACL"); | 692 | rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, |
693 | cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid); | 693 | pfid); |
694 | if (rc) { | ||
695 | cFYI(1, "%s: Getting ACL failed with error: %d", | ||
696 | __func__, rc); | ||
697 | goto cgii_exit; | ||
698 | } | ||
694 | } | 699 | } |
695 | #endif | 700 | #endif |
696 | 701 | ||
@@ -881,8 +886,10 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
881 | rc = cifs_get_inode_info(&inode, full_path, NULL, sb, | 886 | rc = cifs_get_inode_info(&inode, full_path, NULL, sb, |
882 | xid, NULL); | 887 | xid, NULL); |
883 | 888 | ||
884 | if (!inode) | 889 | if (!inode) { |
885 | return ERR_PTR(rc); | 890 | inode = ERR_PTR(rc); |
891 | goto out; | ||
892 | } | ||
886 | 893 | ||
887 | #ifdef CONFIG_CIFS_FSCACHE | 894 | #ifdef CONFIG_CIFS_FSCACHE |
888 | /* populate tcon->resource_id */ | 895 | /* populate tcon->resource_id */ |
@@ -898,13 +905,11 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
898 | inode->i_uid = cifs_sb->mnt_uid; | 905 | inode->i_uid = cifs_sb->mnt_uid; |
899 | inode->i_gid = cifs_sb->mnt_gid; | 906 | inode->i_gid = cifs_sb->mnt_gid; |
900 | } else if (rc) { | 907 | } else if (rc) { |
901 | kfree(full_path); | ||
902 | _FreeXid(xid); | ||
903 | iget_failed(inode); | 908 | iget_failed(inode); |
904 | return ERR_PTR(rc); | 909 | inode = ERR_PTR(rc); |
905 | } | 910 | } |
906 | 911 | ||
907 | 912 | out: | |
908 | kfree(full_path); | 913 | kfree(full_path); |
909 | /* can not call macro FreeXid here since in a void func | 914 | /* can not call macro FreeXid here since in a void func |
910 | * TODO: This is no longer true | 915 | * TODO: This is no longer true |
@@ -1670,7 +1675,9 @@ cifs_inode_needs_reval(struct inode *inode) | |||
1670 | return false; | 1675 | return false; |
1671 | } | 1676 | } |
1672 | 1677 | ||
1673 | /* check invalid_mapping flag and zap the cache if it's set */ | 1678 | /* |
1679 | * Zap the cache. Called when invalid_mapping flag is set. | ||
1680 | */ | ||
1674 | static void | 1681 | static void |
1675 | cifs_invalidate_mapping(struct inode *inode) | 1682 | cifs_invalidate_mapping(struct inode *inode) |
1676 | { | 1683 | { |
@@ -2115,9 +2122,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) | |||
2115 | if (attrs->ia_valid & ATTR_MODE) { | 2122 | if (attrs->ia_valid & ATTR_MODE) { |
2116 | rc = 0; | 2123 | rc = 0; |
2117 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 2124 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
2118 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) | 2125 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
2119 | rc = mode_to_acl(inode, full_path, mode); | 2126 | rc = mode_to_cifs_acl(inode, full_path, mode); |
2120 | else | 2127 | if (rc) { |
2128 | cFYI(1, "%s: Setting ACL failed with error: %d", | ||
2129 | __func__, rc); | ||
2130 | goto cifs_setattr_exit; | ||
2131 | } | ||
2132 | } else | ||
2121 | #endif | 2133 | #endif |
2122 | if (((mode & S_IWUGO) == 0) && | 2134 | if (((mode & S_IWUGO) == 0) && |
2123 | (cifsInode->cifsAttrs & ATTR_READONLY) == 0) { | 2135 | (cifsInode->cifsAttrs & ATTR_READONLY) == 0) { |