Merge branch 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[cascardo/linux.git] / fs / f2fs / namei.c
index 300aef8..e80ed03 100644 (file)
@@ -454,7 +454,7 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
                ostr.name = sd->encrypted_path;
                ostr.len = disk_link.len;
                err = fscrypt_fname_usr_to_disk(inode, &istr, &ostr);
-               if (err < 0)
+               if (err)
                        goto err_out;
 
                sd->len = cpu_to_le16(ostr.len);
@@ -1051,7 +1051,7 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
                goto errout;
 
        res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr);
-       if (res < 0)
+       if (res)
                goto errout;
 
        /* this is broken symlink case */
@@ -1063,7 +1063,7 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
        paddr = pstr.name;
 
        /* Null-terminate the name */
-       paddr[res] = '\0';
+       paddr[pstr.len] = '\0';
 
        put_page(cpage);
        set_delayed_call(done, kfree_link, paddr);
@@ -1080,10 +1080,7 @@ const struct inode_operations f2fs_encrypted_symlink_inode_operations = {
        .getattr        = f2fs_getattr,
        .setattr        = f2fs_setattr,
 #ifdef CONFIG_F2FS_FS_XATTR
-       .setxattr       = generic_setxattr,
-       .getxattr       = generic_getxattr,
        .listxattr      = f2fs_listxattr,
-       .removexattr    = generic_removexattr,
 #endif
 };
 
@@ -1103,10 +1100,7 @@ const struct inode_operations f2fs_dir_inode_operations = {
        .get_acl        = f2fs_get_acl,
        .set_acl        = f2fs_set_acl,
 #ifdef CONFIG_F2FS_FS_XATTR
-       .setxattr       = generic_setxattr,
-       .getxattr       = generic_getxattr,
        .listxattr      = f2fs_listxattr,
-       .removexattr    = generic_removexattr,
 #endif
 };
 
@@ -1116,10 +1110,7 @@ const struct inode_operations f2fs_symlink_inode_operations = {
        .getattr        = f2fs_getattr,
        .setattr        = f2fs_setattr,
 #ifdef CONFIG_F2FS_FS_XATTR
-       .setxattr       = generic_setxattr,
-       .getxattr       = generic_getxattr,
        .listxattr      = f2fs_listxattr,
-       .removexattr    = generic_removexattr,
 #endif
 };
 
@@ -1129,9 +1120,6 @@ const struct inode_operations f2fs_special_inode_operations = {
        .get_acl        = f2fs_get_acl,
        .set_acl        = f2fs_set_acl,
 #ifdef CONFIG_F2FS_FS_XATTR
-       .setxattr       = generic_setxattr,
-       .getxattr       = generic_getxattr,
        .listxattr      = f2fs_listxattr,
-       .removexattr    = generic_removexattr,
 #endif
 };