OSDN Git Service

f2fs: avoid duplicated permission check for "trusted." xattrs
authorHyunchul Lee <cheol.lee@lge.com>
Thu, 19 Jul 2018 00:23:57 +0000 (09:23 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 18 Sep 2018 20:37:14 +0000 (13:37 -0700)
Because xattr_permission already checks CAP_SYS_ADMIN
capability, we don't need to check it.

Signed-off-by: Hyunchul Lee <cheol.lee@lge.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/xattr.c

index 61a5d92..34b7f69 100644 (file)
@@ -38,9 +38,6 @@ static size_t f2fs_xattr_generic_list(const struct xattr_handler *handler,
                        return -EOPNOTSUPP;
                break;
        case F2FS_XATTR_INDEX_TRUSTED:
-               if (!capable(CAP_SYS_ADMIN))
-                       return -EPERM;
-               break;
        case F2FS_XATTR_INDEX_SECURITY:
                break;
        default:
@@ -69,9 +66,6 @@ static int f2fs_xattr_generic_get(const struct xattr_handler *handler,
                        return -EOPNOTSUPP;
                break;
        case F2FS_XATTR_INDEX_TRUSTED:
-               if (!capable(CAP_SYS_ADMIN))
-                       return -EPERM;
-               break;
        case F2FS_XATTR_INDEX_SECURITY:
                break;
        default: