diff options
author | Christoph Hellwig <hch@lst.de> | 2006-01-09 23:51:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 11:01:30 -0500 |
commit | b98932cb514eef404c6168c9a15cf28851498dea (patch) | |
tree | 445c3d1b2510dec9ba5caf38e9e44e1d96a712cb | |
parent | c37ef806a3e1c0bca65fd03b7590d56d19625da4 (diff) |
[PATCH] remove reiserfs xattr permission checks
remove checks now in the VFS
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/reiserfs/xattr.c | 21 | ||||
-rw-r--r-- | fs/reiserfs/xattr_user.c | 30 |
2 files changed, 0 insertions, 51 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index f1895f0a278e..6f99e01f94ab 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -497,12 +497,6 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer, | |||
497 | struct iattr newattrs; | 497 | struct iattr newattrs; |
498 | __u32 xahash = 0; | 498 | __u32 xahash = 0; |
499 | 499 | ||
500 | if (IS_RDONLY(inode)) | ||
501 | return -EROFS; | ||
502 | |||
503 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) | ||
504 | return -EPERM; | ||
505 | |||
506 | if (get_inode_sd_version(inode) == STAT_DATA_V1) | 500 | if (get_inode_sd_version(inode) == STAT_DATA_V1) |
507 | return -EOPNOTSUPP; | 501 | return -EOPNOTSUPP; |
508 | 502 | ||
@@ -758,9 +752,6 @@ int reiserfs_xattr_del(struct inode *inode, const char *name) | |||
758 | struct dentry *dir; | 752 | struct dentry *dir; |
759 | int err; | 753 | int err; |
760 | 754 | ||
761 | if (IS_RDONLY(inode)) | ||
762 | return -EROFS; | ||
763 | |||
764 | dir = open_xa_dir(inode, FL_READONLY); | 755 | dir = open_xa_dir(inode, FL_READONLY); |
765 | if (IS_ERR(dir)) { | 756 | if (IS_ERR(dir)) { |
766 | err = PTR_ERR(dir); | 757 | err = PTR_ERR(dir); |
@@ -984,12 +975,6 @@ reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value, | |||
984 | get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) | 975 | get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) |
985 | return -EOPNOTSUPP; | 976 | return -EOPNOTSUPP; |
986 | 977 | ||
987 | if (IS_RDONLY(dentry->d_inode)) | ||
988 | return -EROFS; | ||
989 | |||
990 | if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) | ||
991 | return -EROFS; | ||
992 | |||
993 | reiserfs_write_lock_xattr_i(dentry->d_inode); | 978 | reiserfs_write_lock_xattr_i(dentry->d_inode); |
994 | lock = !has_xattr_dir(dentry->d_inode); | 979 | lock = !has_xattr_dir(dentry->d_inode); |
995 | if (lock) | 980 | if (lock) |
@@ -1019,12 +1004,6 @@ int reiserfs_removexattr(struct dentry *dentry, const char *name) | |||
1019 | get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) | 1004 | get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) |
1020 | return -EOPNOTSUPP; | 1005 | return -EOPNOTSUPP; |
1021 | 1006 | ||
1022 | if (IS_RDONLY(dentry->d_inode)) | ||
1023 | return -EROFS; | ||
1024 | |||
1025 | if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) | ||
1026 | return -EPERM; | ||
1027 | |||
1028 | reiserfs_write_lock_xattr_i(dentry->d_inode); | 1007 | reiserfs_write_lock_xattr_i(dentry->d_inode); |
1029 | reiserfs_read_lock_xattrs(dentry->d_sb); | 1008 | reiserfs_read_lock_xattrs(dentry->d_sb); |
1030 | 1009 | ||
diff --git a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c index 51458048ca66..073f39364b11 100644 --- a/fs/reiserfs/xattr_user.c +++ b/fs/reiserfs/xattr_user.c | |||
@@ -16,18 +16,10 @@ static int | |||
16 | user_get(struct inode *inode, const char *name, void *buffer, size_t size) | 16 | user_get(struct inode *inode, const char *name, void *buffer, size_t size) |
17 | { | 17 | { |
18 | 18 | ||
19 | int error; | ||
20 | |||
21 | if (strlen(name) < sizeof(XATTR_USER_PREFIX)) | 19 | if (strlen(name) < sizeof(XATTR_USER_PREFIX)) |
22 | return -EINVAL; | 20 | return -EINVAL; |
23 | |||
24 | if (!reiserfs_xattrs_user(inode->i_sb)) | 21 | if (!reiserfs_xattrs_user(inode->i_sb)) |
25 | return -EOPNOTSUPP; | 22 | return -EOPNOTSUPP; |
26 | |||
27 | error = reiserfs_permission_locked(inode, MAY_READ, NULL); | ||
28 | if (error) | ||
29 | return error; | ||
30 | |||
31 | return reiserfs_xattr_get(inode, name, buffer, size); | 23 | return reiserfs_xattr_get(inode, name, buffer, size); |
32 | } | 24 | } |
33 | 25 | ||
@@ -36,43 +28,21 @@ user_set(struct inode *inode, const char *name, const void *buffer, | |||
36 | size_t size, int flags) | 28 | size_t size, int flags) |
37 | { | 29 | { |
38 | 30 | ||
39 | int error; | ||
40 | |||
41 | if (strlen(name) < sizeof(XATTR_USER_PREFIX)) | 31 | if (strlen(name) < sizeof(XATTR_USER_PREFIX)) |
42 | return -EINVAL; | 32 | return -EINVAL; |
43 | 33 | ||
44 | if (!reiserfs_xattrs_user(inode->i_sb)) | 34 | if (!reiserfs_xattrs_user(inode->i_sb)) |
45 | return -EOPNOTSUPP; | 35 | return -EOPNOTSUPP; |
46 | |||
47 | if (!S_ISREG(inode->i_mode) && | ||
48 | (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) | ||
49 | return -EPERM; | ||
50 | |||
51 | error = reiserfs_permission_locked(inode, MAY_WRITE, NULL); | ||
52 | if (error) | ||
53 | return error; | ||
54 | |||
55 | return reiserfs_xattr_set(inode, name, buffer, size, flags); | 36 | return reiserfs_xattr_set(inode, name, buffer, size, flags); |
56 | } | 37 | } |
57 | 38 | ||
58 | static int user_del(struct inode *inode, const char *name) | 39 | static int user_del(struct inode *inode, const char *name) |
59 | { | 40 | { |
60 | int error; | ||
61 | |||
62 | if (strlen(name) < sizeof(XATTR_USER_PREFIX)) | 41 | if (strlen(name) < sizeof(XATTR_USER_PREFIX)) |
63 | return -EINVAL; | 42 | return -EINVAL; |
64 | 43 | ||
65 | if (!reiserfs_xattrs_user(inode->i_sb)) | 44 | if (!reiserfs_xattrs_user(inode->i_sb)) |
66 | return -EOPNOTSUPP; | 45 | return -EOPNOTSUPP; |
67 | |||
68 | if (!S_ISREG(inode->i_mode) && | ||
69 | (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) | ||
70 | return -EPERM; | ||
71 | |||
72 | error = reiserfs_permission_locked(inode, MAY_WRITE, NULL); | ||
73 | if (error) | ||
74 | return error; | ||
75 | |||
76 | return 0; | 46 | return 0; |
77 | } | 47 | } |
78 | 48 | ||