diff options
Diffstat (limited to 'fs/ext3/xattr_user.c')
-rw-r--r-- | fs/ext3/xattr_user.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/fs/ext3/xattr_user.c b/fs/ext3/xattr_user.c index e907cae7a07c..a85a0a17c4fd 100644 --- a/fs/ext3/xattr_user.c +++ b/fs/ext3/xattr_user.c | |||
@@ -37,16 +37,10 @@ static int | |||
37 | ext3_xattr_user_get(struct inode *inode, const char *name, | 37 | ext3_xattr_user_get(struct inode *inode, const char *name, |
38 | void *buffer, size_t size) | 38 | void *buffer, size_t size) |
39 | { | 39 | { |
40 | int error; | ||
41 | |||
42 | if (strcmp(name, "") == 0) | 40 | if (strcmp(name, "") == 0) |
43 | return -EINVAL; | 41 | return -EINVAL; |
44 | if (!test_opt(inode->i_sb, XATTR_USER)) | 42 | if (!test_opt(inode->i_sb, XATTR_USER)) |
45 | return -EOPNOTSUPP; | 43 | return -EOPNOTSUPP; |
46 | error = permission(inode, MAY_READ, NULL); | ||
47 | if (error) | ||
48 | return error; | ||
49 | |||
50 | return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size); | 44 | return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size); |
51 | } | 45 | } |
52 | 46 | ||
@@ -54,19 +48,10 @@ static int | |||
54 | ext3_xattr_user_set(struct inode *inode, const char *name, | 48 | ext3_xattr_user_set(struct inode *inode, const char *name, |
55 | const void *value, size_t size, int flags) | 49 | const void *value, size_t size, int flags) |
56 | { | 50 | { |
57 | int error; | ||
58 | |||
59 | if (strcmp(name, "") == 0) | 51 | if (strcmp(name, "") == 0) |
60 | return -EINVAL; | 52 | return -EINVAL; |
61 | if (!test_opt(inode->i_sb, XATTR_USER)) | 53 | if (!test_opt(inode->i_sb, XATTR_USER)) |
62 | return -EOPNOTSUPP; | 54 | return -EOPNOTSUPP; |
63 | if ( !S_ISREG(inode->i_mode) && | ||
64 | (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) | ||
65 | return -EPERM; | ||
66 | error = permission(inode, MAY_WRITE, NULL); | ||
67 | if (error) | ||
68 | return error; | ||
69 | |||
70 | return ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name, | 55 | return ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name, |
71 | value, size, flags); | 56 | value, size, flags); |
72 | } | 57 | } |