diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 13:38:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 13:38:46 -0400 |
commit | 38c46578ffd8ffbfec514c2a9876d527303322d6 (patch) | |
tree | d55ad8a52048f70bc6ef51d388c0f21ff467155e /fs/gfs2/ops_inode.c | |
parent | e7849f16c13476288fe4fbd420975e8456c75aa0 (diff) | |
parent | 4abaca17e758e3326c96ced88b2cd9b7b84922f6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw:
[GFS2] Fix GFS2's use of do_div() in its quota calculations
[GFS2] Remove unused declaration
[GFS2] Remove support for unused and pointless flag
[GFS2] Replace rgrp "recent list" with mru list
[GFS2] Allow local DF locks when holding a cached EX glock
[GFS2] Fix delayed demote race
[GFS2] don't call permission()
[GFS2] Fix module building
[GFS2] Glock documentation
[GFS2] Remove all_list from lock_dlm
[GFS2] Remove obsolete conversion deadlock avoidance code
[GFS2] Remove remote lock dropping code
[GFS2] kernel panic mounting volume
[GFS2] Revise readpage locking
[GFS2] Fix ordering of args for list_add
[GFS2] trivial sparse lock annotations
[GFS2] No lock_nolock
[GFS2] Fix ordering bug in lock_dlm
[GFS2] Clean up the glock core
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r-- | fs/gfs2/ops_inode.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 2686ad4c0029..1e252dfc5294 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -163,7 +163,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, | |||
163 | if (error) | 163 | if (error) |
164 | goto out; | 164 | goto out; |
165 | 165 | ||
166 | error = permission(dir, MAY_WRITE | MAY_EXEC, NULL); | 166 | error = gfs2_permission(dir, MAY_WRITE | MAY_EXEC); |
167 | if (error) | 167 | if (error) |
168 | goto out_gunlock; | 168 | goto out_gunlock; |
169 | 169 | ||
@@ -669,7 +669,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
669 | } | 669 | } |
670 | } | 670 | } |
671 | } else { | 671 | } else { |
672 | error = permission(ndir, MAY_WRITE | MAY_EXEC, NULL); | 672 | error = gfs2_permission(ndir, MAY_WRITE | MAY_EXEC); |
673 | if (error) | 673 | if (error) |
674 | goto out_gunlock; | 674 | goto out_gunlock; |
675 | 675 | ||
@@ -704,7 +704,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
704 | /* Check out the dir to be renamed */ | 704 | /* Check out the dir to be renamed */ |
705 | 705 | ||
706 | if (dir_rename) { | 706 | if (dir_rename) { |
707 | error = permission(odentry->d_inode, MAY_WRITE, NULL); | 707 | error = gfs2_permission(odentry->d_inode, MAY_WRITE); |
708 | if (error) | 708 | if (error) |
709 | goto out_gunlock; | 709 | goto out_gunlock; |
710 | } | 710 | } |
@@ -891,7 +891,7 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
891 | * Returns: errno | 891 | * Returns: errno |
892 | */ | 892 | */ |
893 | 893 | ||
894 | static int gfs2_permission(struct inode *inode, int mask, struct nameidata *nd) | 894 | int gfs2_permission(struct inode *inode, int mask) |
895 | { | 895 | { |
896 | struct gfs2_inode *ip = GFS2_I(inode); | 896 | struct gfs2_inode *ip = GFS2_I(inode); |
897 | struct gfs2_holder i_gh; | 897 | struct gfs2_holder i_gh; |
@@ -905,13 +905,22 @@ static int gfs2_permission(struct inode *inode, int mask, struct nameidata *nd) | |||
905 | unlock = 1; | 905 | unlock = 1; |
906 | } | 906 | } |
907 | 907 | ||
908 | error = generic_permission(inode, mask, gfs2_check_acl); | 908 | if ((mask & MAY_WRITE) && IS_IMMUTABLE(inode)) |
909 | error = -EACCES; | ||
910 | else | ||
911 | error = generic_permission(inode, mask, gfs2_check_acl); | ||
909 | if (unlock) | 912 | if (unlock) |
910 | gfs2_glock_dq_uninit(&i_gh); | 913 | gfs2_glock_dq_uninit(&i_gh); |
911 | 914 | ||
912 | return error; | 915 | return error; |
913 | } | 916 | } |
914 | 917 | ||
918 | static int gfs2_iop_permission(struct inode *inode, int mask, | ||
919 | struct nameidata *nd) | ||
920 | { | ||
921 | return gfs2_permission(inode, mask); | ||
922 | } | ||
923 | |||
915 | static int setattr_size(struct inode *inode, struct iattr *attr) | 924 | static int setattr_size(struct inode *inode, struct iattr *attr) |
916 | { | 925 | { |
917 | struct gfs2_inode *ip = GFS2_I(inode); | 926 | struct gfs2_inode *ip = GFS2_I(inode); |
@@ -1141,7 +1150,7 @@ static int gfs2_removexattr(struct dentry *dentry, const char *name) | |||
1141 | } | 1150 | } |
1142 | 1151 | ||
1143 | const struct inode_operations gfs2_file_iops = { | 1152 | const struct inode_operations gfs2_file_iops = { |
1144 | .permission = gfs2_permission, | 1153 | .permission = gfs2_iop_permission, |
1145 | .setattr = gfs2_setattr, | 1154 | .setattr = gfs2_setattr, |
1146 | .getattr = gfs2_getattr, | 1155 | .getattr = gfs2_getattr, |
1147 | .setxattr = gfs2_setxattr, | 1156 | .setxattr = gfs2_setxattr, |
@@ -1160,7 +1169,7 @@ const struct inode_operations gfs2_dir_iops = { | |||
1160 | .rmdir = gfs2_rmdir, | 1169 | .rmdir = gfs2_rmdir, |
1161 | .mknod = gfs2_mknod, | 1170 | .mknod = gfs2_mknod, |
1162 | .rename = gfs2_rename, | 1171 | .rename = gfs2_rename, |
1163 | .permission = gfs2_permission, | 1172 | .permission = gfs2_iop_permission, |
1164 | .setattr = gfs2_setattr, | 1173 | .setattr = gfs2_setattr, |
1165 | .getattr = gfs2_getattr, | 1174 | .getattr = gfs2_getattr, |
1166 | .setxattr = gfs2_setxattr, | 1175 | .setxattr = gfs2_setxattr, |
@@ -1172,7 +1181,7 @@ const struct inode_operations gfs2_dir_iops = { | |||
1172 | const struct inode_operations gfs2_symlink_iops = { | 1181 | const struct inode_operations gfs2_symlink_iops = { |
1173 | .readlink = gfs2_readlink, | 1182 | .readlink = gfs2_readlink, |
1174 | .follow_link = gfs2_follow_link, | 1183 | .follow_link = gfs2_follow_link, |
1175 | .permission = gfs2_permission, | 1184 | .permission = gfs2_iop_permission, |
1176 | .setattr = gfs2_setattr, | 1185 | .setattr = gfs2_setattr, |
1177 | .getattr = gfs2_getattr, | 1186 | .getattr = gfs2_getattr, |
1178 | .setxattr = gfs2_setxattr, | 1187 | .setxattr = gfs2_setxattr, |