Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357792
b: refs/heads/master
c: b59c8b6
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent ffd30bc commit d37c8a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: e08d8d7f201dc1e64f5d9d5aa2cd4f37aecaaab4
refs/heads/master: b59c8b6f9d1b1220e5ed72152f42a658bf739d90
13 changes: 7 additions & 6 deletions trunk/fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,13 @@ static void qd_unlock(struct gfs2_quota_data *qd)
qd_put(qd);
}

static int qdsb_get(struct gfs2_sbd *sdp, int user, u32 id,
static int qdsb_get(struct gfs2_sbd *sdp, struct kqid qid,
struct gfs2_quota_data **qdp)
{
int error;

error = qd_get(sdp, user, id, qdp);
error = qd_get(sdp, qid.type == USRQUOTA ? QUOTA_USER : QUOTA_GROUP,
from_kqid(&init_user_ns, qid), qdp);
if (error)
return error;

Expand Down Expand Up @@ -518,28 +519,28 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
return 0;

error = qdsb_get(sdp, QUOTA_USER, ip->i_inode.i_uid, qd);
error = qdsb_get(sdp, make_kqid_uid(ip->i_inode.i_uid), qd);
if (error)
goto out;
ip->i_res->rs_qa_qd_num++;
qd++;

error = qdsb_get(sdp, QUOTA_GROUP, ip->i_inode.i_gid, qd);
error = qdsb_get(sdp, make_kqid_gid(ip->i_inode.i_gid), qd);
if (error)
goto out;
ip->i_res->rs_qa_qd_num++;
qd++;

if (uid != NO_UID_QUOTA_CHANGE && uid != ip->i_inode.i_uid) {
error = qdsb_get(sdp, QUOTA_USER, uid, qd);
error = qdsb_get(sdp, make_kqid_uid(uid), qd);
if (error)
goto out;
ip->i_res->rs_qa_qd_num++;
qd++;
}

if (gid != NO_GID_QUOTA_CHANGE && gid != ip->i_inode.i_gid) {
error = qdsb_get(sdp, QUOTA_GROUP, gid, qd);
error = qdsb_get(sdp, make_kqid_gid(gid), qd);
if (error)
goto out;
ip->i_res->rs_qa_qd_num++;
Expand Down

0 comments on commit d37c8a3

Please sign in to comment.