Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357793
b: refs/heads/master
c: ed87dab
h: refs/heads/master
i:
  357791: ffd30bc
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent d37c8a3 commit b4c9dd4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 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: b59c8b6f9d1b1220e5ed72152f42a658bf739d90
refs/heads/master: ed87dabcc3fc0a5040f95dd3f7206cffebca5c79
5 changes: 3 additions & 2 deletions trunk/fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,13 +1177,14 @@ static int gfs2_quota_sync_timeo(struct super_block *sb, int type)
return gfs2_quota_sync(sb, type);
}

int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id)
int gfs2_quota_refresh(struct gfs2_sbd *sdp, struct kqid qid)
{
struct gfs2_quota_data *qd;
struct gfs2_holder q_gh;
int error;

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

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/quota.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
u32 uid, u32 gid);

extern int gfs2_quota_sync(struct super_block *sb, int type);
extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id);
extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, struct kqid qid);

extern int gfs2_quota_init(struct gfs2_sbd *sdp);
extern void gfs2_quota_cleanup(struct gfs2_sbd *sdp);
Expand Down
14 changes: 12 additions & 2 deletions trunk/fs/gfs2/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf,
static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,
size_t len)
{
struct kqid qid;
int error;
u32 id;

Expand All @@ -183,13 +184,18 @@ static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,

id = simple_strtoul(buf, NULL, 0);

error = gfs2_quota_refresh(sdp, 1, id);
qid = make_kqid(current_user_ns(), USRQUOTA, id);
if (!qid_valid(qid))
return -EINVAL;

error = gfs2_quota_refresh(sdp, qid);
return error ? error : len;
}

static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf,
size_t len)
{
struct kqid qid;
int error;
u32 id;

Expand All @@ -198,7 +204,11 @@ static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf,

id = simple_strtoul(buf, NULL, 0);

error = gfs2_quota_refresh(sdp, 0, id);
qid = make_kqid(current_user_ns(), GRPQUOTA, id);
if (!qid_valid(qid))
return -EINVAL;

error = gfs2_quota_refresh(sdp, qid);
return error ? error : len;
}

Expand Down

0 comments on commit b4c9dd4

Please sign in to comment.