Skip to content

Commit

Permalink
gfs2: Remove improper checks in gfs2_set_dqblk.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent ecb528e commit 393551e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,22 +1543,16 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid,
switch(qid.type) {
case USRQUOTA:
type = QUOTA_USER;
if (fdq->d_flags != FS_USER_QUOTA)
return -EINVAL;
break;
case GRPQUOTA:
type = QUOTA_GROUP;
if (fdq->d_flags != FS_GROUP_QUOTA)
return -EINVAL;
break;
default:
return -EINVAL;
}

if (fdq->d_fieldmask & ~GFS2_FIELDMASK)
return -EINVAL;
if (fdq->d_id != from_kqid(&init_user_ns, qid))
return -EINVAL;

error = qd_get(sdp, type, from_kqid(&init_user_ns, qid), &qd);
if (error)
Expand Down

0 comments on commit 393551e

Please sign in to comment.