]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gfs2: Report quotas in the caller's user namespace.
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 1 Feb 2013 02:15:33 +0000 (18:15 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 13 Feb 2013 14:15:02 +0000 (06:15 -0800)
When a quota is queried return the uid or the gid in the mapped into
the caller's user namespace.  In addition perform the munged version
of the mapping so that instead of -1 a value that does not map is
reported as the overflowuid or the overflowgid.

Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/gfs2/quota.c

index dbfacaa8b6fb1a4387f3a3c9f9f787ae8527b4d3..f8279eed56e17fb99d914bbca543961d7f8ded44 100644 (file)
@@ -1509,7 +1509,7 @@ static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid,
        qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lksb.sb_lvbptr;
        fdq->d_version = FS_DQUOT_VERSION;
        fdq->d_flags = (type == QUOTA_USER) ? FS_USER_QUOTA : FS_GROUP_QUOTA;
-       fdq->d_id = from_kqid(&init_user_ns, qid);
+       fdq->d_id = from_kqid_munged(current_user_ns(), qid);
        fdq->d_blk_hardlimit = be64_to_cpu(qlvb->qb_limit) << sdp->sd_fsb2bb_shift;
        fdq->d_blk_softlimit = be64_to_cpu(qlvb->qb_warn) << sdp->sd_fsb2bb_shift;
        fdq->d_bcount = be64_to_cpu(qlvb->qb_value) << sdp->sd_fsb2bb_shift;