diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-01 05:09:03 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 09:15:00 -0500 |
commit | 393551e9898136513007b1e88a25bd4dcdb0d759 (patch) | |
tree | b9e27269be741223244cec66278d0f9602763c35 /fs/gfs2 | |
parent | ecb528e3ea208750693731538411f86f78a4d965 (diff) |
gfs2: Remove improper checks in gfs2_set_dqblk.
In set_dqblk it is an error to look at fdq->d_id or fdq->d_flags.
Userspace quota applications do not set these fields when calling
quotactl(Q_XSETQLIM,...), and the kernel does not set those fields
when quota_setquota calls set_dqblk.
gfs2 never looks at fdq->d_id or fdq->d_flags after checking
to see if they match the id and type supplied to set_dqblk.
No other linux filesystem in set_dqblk looks at either fdq->d_id
or fdq->d_flags.
Therefore remove these bogus checks from gfs2 and allow normal
quota setting applications to work.
Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/quota.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index ae55e248c3b7..e4f6ccf3da64 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -1543,13 +1543,9 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid, | |||
1543 | switch(qid.type) { | 1543 | switch(qid.type) { |
1544 | case USRQUOTA: | 1544 | case USRQUOTA: |
1545 | type = QUOTA_USER; | 1545 | type = QUOTA_USER; |
1546 | if (fdq->d_flags != FS_USER_QUOTA) | ||
1547 | return -EINVAL; | ||
1548 | break; | 1546 | break; |
1549 | case GRPQUOTA: | 1547 | case GRPQUOTA: |
1550 | type = QUOTA_GROUP; | 1548 | type = QUOTA_GROUP; |
1551 | if (fdq->d_flags != FS_GROUP_QUOTA) | ||
1552 | return -EINVAL; | ||
1553 | break; | 1549 | break; |
1554 | default: | 1550 | default: |
1555 | return -EINVAL; | 1551 | return -EINVAL; |
@@ -1557,8 +1553,6 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid, | |||
1557 | 1553 | ||
1558 | if (fdq->d_fieldmask & ~GFS2_FIELDMASK) | 1554 | if (fdq->d_fieldmask & ~GFS2_FIELDMASK) |
1559 | return -EINVAL; | 1555 | return -EINVAL; |
1560 | if (fdq->d_id != from_kqid(&init_user_ns, qid)) | ||
1561 | return -EINVAL; | ||
1562 | 1556 | ||
1563 | error = qd_get(sdp, type, from_kqid(&init_user_ns, qid), &qd); | 1557 | error = qd_get(sdp, type, from_kqid(&init_user_ns, qid), &qd); |
1564 | if (error) | 1558 | if (error) |