Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17560
b: refs/heads/master
c: 3542c6e
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Jan 10, 2006
1 parent b0e7ffe commit aeb6ac5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b98932cb514eef404c6168c9a15cf28851498dea
refs/heads/master: 3542c6e18f6470bad2bde1e94331e4f488a8d3f1
5 changes: 5 additions & 0 deletions trunk/fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ xfs_attrmulti_attr_set(
char *kbuf;
int error = EFAULT;

if (IS_RDONLY(&vp->v_inode))
return -EROFS;
if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
return EPERM;
if (len > XATTR_SIZE_MAX)
Expand Down Expand Up @@ -557,6 +559,9 @@ xfs_attrmulti_attr_remove(
{
int error;


if (IS_RDONLY(&vp->v_inode))
return -EROFS;
if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
return EPERM;

Expand Down
29 changes: 3 additions & 26 deletions trunk/fs/xfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ xfs_attr_fetch(xfs_inode_t *ip, const char *name, int namelen,
ip->i_d.di_anextents == 0))
return(ENOATTR);

if (!(flags & (ATTR_KERNACCESS|ATTR_SECURE))) {
if ((error = xfs_iaccess(ip, S_IRUSR, cred)))
return(XFS_ERROR(error));
}

/*
* Fill in the arg structure for this request.
*/
Expand Down Expand Up @@ -425,7 +420,7 @@ xfs_attr_set(bhv_desc_t *bdp, const char *name, char *value, int valuelen, int f
struct cred *cred)
{
xfs_inode_t *dp;
int namelen, error;
int namelen;

namelen = strlen(name);
if (namelen >= MAXNAMELEN)
Expand All @@ -437,14 +432,6 @@ xfs_attr_set(bhv_desc_t *bdp, const char *name, char *value, int valuelen, int f
if (XFS_FORCED_SHUTDOWN(dp->i_mount))
return (EIO);

xfs_ilock(dp, XFS_ILOCK_SHARED);
if (!(flags & ATTR_SECURE) &&
(error = xfs_iaccess(dp, S_IWUSR, cred))) {
xfs_iunlock(dp, XFS_ILOCK_SHARED);
return(XFS_ERROR(error));
}
xfs_iunlock(dp, XFS_ILOCK_SHARED);

return xfs_attr_set_int(dp, name, namelen, value, valuelen, flags);
}

Expand Down Expand Up @@ -579,7 +566,7 @@ int
xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred)
{
xfs_inode_t *dp;
int namelen, error;
int namelen;

namelen = strlen(name);
if (namelen >= MAXNAMELEN)
Expand All @@ -592,11 +579,7 @@ xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred)
return (EIO);

xfs_ilock(dp, XFS_ILOCK_SHARED);
if (!(flags & ATTR_SECURE) &&
(error = xfs_iaccess(dp, S_IWUSR, cred))) {
xfs_iunlock(dp, XFS_ILOCK_SHARED);
return(XFS_ERROR(error));
} else if (XFS_IFORK_Q(dp) == 0 ||
if (XFS_IFORK_Q(dp) == 0 ||
(dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
dp->i_d.di_anextents == 0)) {
xfs_iunlock(dp, XFS_ILOCK_SHARED);
Expand Down Expand Up @@ -668,12 +651,6 @@ xfs_attr_list(bhv_desc_t *bdp, char *buffer, int bufsize, int flags,
return (EIO);

xfs_ilock(dp, XFS_ILOCK_SHARED);
if (!(flags & ATTR_SECURE) &&
(error = xfs_iaccess(dp, S_IRUSR, cred))) {
xfs_iunlock(dp, XFS_ILOCK_SHARED);
return(XFS_ERROR(error));
}

/*
* Decide on what work routines to call based on the inode size.
*/
Expand Down

0 comments on commit aeb6ac5

Please sign in to comment.