From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: Seth Forshee <seth.forshee-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Cc: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>,
Jann Horn <jannh-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Linux Containers
<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>,
James Bottomley
<James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>,
Michael Kerrisk
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Djalal Harouni <tixxdz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2 review 09/11] quota: Handle quota data stored in s_user_ns.
Date: Sat, 02 Jul 2016 12:33:29 -0500 [thread overview]
Message-ID: <87mvm03pxy.fsf_-_@x220.int.ebiederm.org> (raw)
In-Reply-To: <20160702172035.19568-9-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> (Eric W. Biederman's message of "Sat, 2 Jul 2016 12:20:33 -0500")
In Q_XSETQLIMIT use sb->s_user_ns to detect when we are dealing with
the filesystems notion of id 0.
For the dquot hashfn translate the qid into sb->s_user_ns to remove
extraneous bits before hashing.
When dealing with generic quota files in quota_tree.c, quota_v1.c, and
quota_v2.c before writing quotas to the file encode them in
sb->s_user_ns, and decode ids read from the file from sb->s_user_ns.
One complication comes up in qtree_get_next_id, as it is possible in
principle for id's to be present in the quota file that do not have a
mapping in the filesystems user namespace. If that is the case the
code is modified to skip the unmapped ids.
Inspired-by: Seth Forshee <seth.forshee-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
Grr. My kconfig was wrong and typo's crept into my previous version
of this patch. Thank you kbuild test robot from catching this.
fs/quota/dquot.c | 4 ++--
fs/quota/quota.c | 2 +-
fs/quota/quota_tree.c | 23 ++++++++++++++---------
fs/quota/quota_v1.c | 6 ++++--
fs/quota/quota_v2.c | 10 ++++++----
5 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 74706b6aa747..9b39925f34f4 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -252,7 +252,7 @@ static int __dquot_initialize(struct inode *inode, int type);
static inline unsigned int
hashfn(const struct super_block *sb, struct kqid qid)
{
- unsigned int id = from_kqid(&init_user_ns, qid);
+ unsigned int id = from_kqid(sb->s_user_ns, qid);
int type = qid.type;
unsigned long tmp;
@@ -748,7 +748,7 @@ void dqput(struct dquot *dquot)
if (!atomic_read(&dquot->dq_count)) {
quota_error(dquot->dq_sb, "trying to free free dquot of %s %d",
quotatypes[dquot->dq_id.type],
- from_kqid(&init_user_ns, dquot->dq_id));
+ from_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id));
BUG();
}
#endif
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 73f6f4cf0a21..35df08ee9c97 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -584,7 +584,7 @@ static int quota_setxquota(struct super_block *sb, int type, qid_t id,
if (!qid_has_mapping(sb->s_user_ns, qid))
return -EINVAL;
/* Are we actually setting timer / warning limits for all users? */
- if (from_kqid(&init_user_ns, qid) == 0 &&
+ if (from_kqid(sb->s_user_ns, qid) == 0 &&
fdq.d_fieldmask & (FS_DQ_WARNS_MASK | FS_DQ_TIMER_MASK)) {
struct qc_info qinfo;
int ret;
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index 0738972e8d3f..4f8f6bdc698c 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -34,7 +34,7 @@ static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth)
static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
{
- qid_t id = from_kqid(&init_user_ns, qid);
+ qid_t id = from_kqid(info->dqi_sb->s_user_ns, qid);
return __get_index(info, id, depth);
}
@@ -554,7 +554,7 @@ static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info,
if (i == qtree_dqstr_in_blk(info)) {
quota_error(dquot->dq_sb,
"Quota for id %u referenced but not present",
- from_kqid(&init_user_ns, dquot->dq_id));
+ from_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id));
ret = -EIO;
goto out_buf;
} else {
@@ -624,7 +624,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
if (offset < 0)
quota_error(sb,"Can't read quota structure "
"for id %u",
- from_kqid(&init_user_ns,
+ from_kqid(sb->s_user_ns,
dquot->dq_id));
dquot->dq_off = 0;
set_bit(DQ_FAKE_B, &dquot->dq_flags);
@@ -643,7 +643,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
if (ret >= 0)
ret = -EIO;
quota_error(sb, "Error while reading quota structure for id %u",
- from_kqid(&init_user_ns, dquot->dq_id));
+ from_kqid(sb->s_user_ns, dquot->dq_id));
set_bit(DQ_FAKE_B, &dquot->dq_flags);
memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
kfree(ddquot);
@@ -721,13 +721,18 @@ out_buf:
int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid)
{
- qid_t id = from_kqid(&init_user_ns, *qid);
+ qid_t id = from_kqid(info->dqi_sb->s_user_ns, *qid);
+ struct kqid next_id;
int ret;
- ret = find_next_id(info, &id, QT_TREEOFF, 0);
- if (ret < 0)
- return ret;
- *qid = make_kqid(&init_user_ns, qid->type, id);
+ do {
+ ret = find_next_id(info, &id, QT_TREEOFF, 0);
+ if (ret < 0)
+ return ret;
+ next_id = make_kqid(info->dqi_sb->s_user_ns, qid->type, id);
+ } while (!qid_valid(next_id)); /* Loop until a mapped id is found */
+
+ *qid = next_id;
return 0;
}
EXPORT_SYMBOL(qtree_get_next_id);
diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c
index 8fe79beced5c..a354f8bed96a 100644
--- a/fs/quota/quota_v1.c
+++ b/fs/quota/quota_v1.c
@@ -54,6 +54,7 @@ static void v1_mem2disk_dqblk(struct v1_disk_dqblk *d, struct mem_dqblk *m)
static int v1_read_dqblk(struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
int type = dquot->dq_id.type;
struct v1_disk_dqblk dqblk;
@@ -64,7 +65,7 @@ static int v1_read_dqblk(struct dquot *dquot)
memset(&dqblk, 0, sizeof(struct v1_disk_dqblk));
dquot->dq_sb->s_op->quota_read(dquot->dq_sb, type, (char *)&dqblk,
sizeof(struct v1_disk_dqblk),
- v1_dqoff(from_kqid(&init_user_ns, dquot->dq_id)));
+ v1_dqoff(from_kqid(dq_user_ns, dquot->dq_id)));
v1_disk2mem_dqblk(&dquot->dq_dqb, &dqblk);
if (dquot->dq_dqb.dqb_bhardlimit == 0 &&
@@ -79,6 +80,7 @@ static int v1_read_dqblk(struct dquot *dquot)
static int v1_commit_dqblk(struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
short type = dquot->dq_id.type;
ssize_t ret;
struct v1_disk_dqblk dqblk;
@@ -95,7 +97,7 @@ static int v1_commit_dqblk(struct dquot *dquot)
if (sb_dqopt(dquot->dq_sb)->files[type])
ret = dquot->dq_sb->s_op->quota_write(dquot->dq_sb, type,
(char *)&dqblk, sizeof(struct v1_disk_dqblk),
- v1_dqoff(from_kqid(&init_user_ns, dquot->dq_id)));
+ v1_dqoff(from_kqid(dq_user_ns, dquot->dq_id)));
if (ret != sizeof(struct v1_disk_dqblk)) {
quota_error(dquot->dq_sb, "dquota write failed");
if (ret >= 0)
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index ca71bf881ad1..54e27b296656 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -199,6 +199,7 @@ static void v2r0_disk2memdqb(struct dquot *dquot, void *dp)
static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
struct v2r0_disk_dqblk *d = dp;
struct mem_dqblk *m = &dquot->dq_dqb;
struct qtree_mem_dqinfo *info =
@@ -212,7 +213,7 @@ static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot)
d->dqb_bsoftlimit = cpu_to_le32(v2_stoqb(m->dqb_bsoftlimit));
d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
d->dqb_btime = cpu_to_le64(m->dqb_btime);
- d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
+ d->dqb_id = cpu_to_le32(from_kqid(dq_user_ns, dquot->dq_id));
if (qtree_entry_unused(info, dp))
d->dqb_itime = cpu_to_le64(1);
}
@@ -225,7 +226,7 @@ static int v2r0_is_id(void *dp, struct dquot *dquot)
if (qtree_entry_unused(info, dp))
return 0;
- return qid_eq(make_kqid(&init_user_ns, dquot->dq_id.type,
+ return qid_eq(make_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id.type,
le32_to_cpu(d->dqb_id)),
dquot->dq_id);
}
@@ -252,6 +253,7 @@ static void v2r1_disk2memdqb(struct dquot *dquot, void *dp)
static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
struct v2r1_disk_dqblk *d = dp;
struct mem_dqblk *m = &dquot->dq_dqb;
struct qtree_mem_dqinfo *info =
@@ -265,7 +267,7 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
d->dqb_bsoftlimit = cpu_to_le64(v2_stoqb(m->dqb_bsoftlimit));
d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
d->dqb_btime = cpu_to_le64(m->dqb_btime);
- d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
+ d->dqb_id = cpu_to_le32(from_kqid(dq_user_ns, dquot->dq_id));
if (qtree_entry_unused(info, dp))
d->dqb_itime = cpu_to_le64(1);
}
@@ -278,7 +280,7 @@ static int v2r1_is_id(void *dp, struct dquot *dquot)
if (qtree_entry_unused(info, dp))
return 0;
- return qid_eq(make_kqid(&init_user_ns, dquot->dq_id.type,
+ return qid_eq(make_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id.type,
le32_to_cpu(d->dqb_id)),
dquot->dq_id);
}
--
2.8.3
WARNING: multiple messages have this Message-ID (diff)
From: ebiederm@xmission.com (Eric W. Biederman)
To: Seth Forshee <seth.forshee@canonical.com>
Cc: Jan Kara <jack@suse.cz>, Jann Horn <jannh@google.com>,
Linux API <linux-api@vger.kernel.org>,
Linux Containers <containers@lists.linux-foundation.org>,
Andy Lutomirski <luto@amacapital.net>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Michael Kerrisk <mtk.manpages@gmail.com>,
linux-fsdevel@vger.kernel.org, Djalal Harouni <tixxdz@gmail.com>
Subject: [PATCH v2 review 09/11] quota: Handle quota data stored in s_user_ns.
Date: Sat, 02 Jul 2016 12:33:29 -0500 [thread overview]
Message-ID: <87mvm03pxy.fsf_-_@x220.int.ebiederm.org> (raw)
In-Reply-To: <20160702172035.19568-9-ebiederm@xmission.com> (Eric W. Biederman's message of "Sat, 2 Jul 2016 12:20:33 -0500")
In Q_XSETQLIMIT use sb->s_user_ns to detect when we are dealing with
the filesystems notion of id 0.
For the dquot hashfn translate the qid into sb->s_user_ns to remove
extraneous bits before hashing.
When dealing with generic quota files in quota_tree.c, quota_v1.c, and
quota_v2.c before writing quotas to the file encode them in
sb->s_user_ns, and decode ids read from the file from sb->s_user_ns.
One complication comes up in qtree_get_next_id, as it is possible in
principle for id's to be present in the quota file that do not have a
mapping in the filesystems user namespace. If that is the case the
code is modified to skip the unmapped ids.
Inspired-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
Grr. My kconfig was wrong and typo's crept into my previous version
of this patch. Thank you kbuild test robot from catching this.
fs/quota/dquot.c | 4 ++--
fs/quota/quota.c | 2 +-
fs/quota/quota_tree.c | 23 ++++++++++++++---------
fs/quota/quota_v1.c | 6 ++++--
fs/quota/quota_v2.c | 10 ++++++----
5 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 74706b6aa747..9b39925f34f4 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -252,7 +252,7 @@ static int __dquot_initialize(struct inode *inode, int type);
static inline unsigned int
hashfn(const struct super_block *sb, struct kqid qid)
{
- unsigned int id = from_kqid(&init_user_ns, qid);
+ unsigned int id = from_kqid(sb->s_user_ns, qid);
int type = qid.type;
unsigned long tmp;
@@ -748,7 +748,7 @@ void dqput(struct dquot *dquot)
if (!atomic_read(&dquot->dq_count)) {
quota_error(dquot->dq_sb, "trying to free free dquot of %s %d",
quotatypes[dquot->dq_id.type],
- from_kqid(&init_user_ns, dquot->dq_id));
+ from_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id));
BUG();
}
#endif
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 73f6f4cf0a21..35df08ee9c97 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -584,7 +584,7 @@ static int quota_setxquota(struct super_block *sb, int type, qid_t id,
if (!qid_has_mapping(sb->s_user_ns, qid))
return -EINVAL;
/* Are we actually setting timer / warning limits for all users? */
- if (from_kqid(&init_user_ns, qid) == 0 &&
+ if (from_kqid(sb->s_user_ns, qid) == 0 &&
fdq.d_fieldmask & (FS_DQ_WARNS_MASK | FS_DQ_TIMER_MASK)) {
struct qc_info qinfo;
int ret;
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index 0738972e8d3f..4f8f6bdc698c 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -34,7 +34,7 @@ static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth)
static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
{
- qid_t id = from_kqid(&init_user_ns, qid);
+ qid_t id = from_kqid(info->dqi_sb->s_user_ns, qid);
return __get_index(info, id, depth);
}
@@ -554,7 +554,7 @@ static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info,
if (i == qtree_dqstr_in_blk(info)) {
quota_error(dquot->dq_sb,
"Quota for id %u referenced but not present",
- from_kqid(&init_user_ns, dquot->dq_id));
+ from_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id));
ret = -EIO;
goto out_buf;
} else {
@@ -624,7 +624,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
if (offset < 0)
quota_error(sb,"Can't read quota structure "
"for id %u",
- from_kqid(&init_user_ns,
+ from_kqid(sb->s_user_ns,
dquot->dq_id));
dquot->dq_off = 0;
set_bit(DQ_FAKE_B, &dquot->dq_flags);
@@ -643,7 +643,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
if (ret >= 0)
ret = -EIO;
quota_error(sb, "Error while reading quota structure for id %u",
- from_kqid(&init_user_ns, dquot->dq_id));
+ from_kqid(sb->s_user_ns, dquot->dq_id));
set_bit(DQ_FAKE_B, &dquot->dq_flags);
memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
kfree(ddquot);
@@ -721,13 +721,18 @@ out_buf:
int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid)
{
- qid_t id = from_kqid(&init_user_ns, *qid);
+ qid_t id = from_kqid(info->dqi_sb->s_user_ns, *qid);
+ struct kqid next_id;
int ret;
- ret = find_next_id(info, &id, QT_TREEOFF, 0);
- if (ret < 0)
- return ret;
- *qid = make_kqid(&init_user_ns, qid->type, id);
+ do {
+ ret = find_next_id(info, &id, QT_TREEOFF, 0);
+ if (ret < 0)
+ return ret;
+ next_id = make_kqid(info->dqi_sb->s_user_ns, qid->type, id);
+ } while (!qid_valid(next_id)); /* Loop until a mapped id is found */
+
+ *qid = next_id;
return 0;
}
EXPORT_SYMBOL(qtree_get_next_id);
diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c
index 8fe79beced5c..a354f8bed96a 100644
--- a/fs/quota/quota_v1.c
+++ b/fs/quota/quota_v1.c
@@ -54,6 +54,7 @@ static void v1_mem2disk_dqblk(struct v1_disk_dqblk *d, struct mem_dqblk *m)
static int v1_read_dqblk(struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
int type = dquot->dq_id.type;
struct v1_disk_dqblk dqblk;
@@ -64,7 +65,7 @@ static int v1_read_dqblk(struct dquot *dquot)
memset(&dqblk, 0, sizeof(struct v1_disk_dqblk));
dquot->dq_sb->s_op->quota_read(dquot->dq_sb, type, (char *)&dqblk,
sizeof(struct v1_disk_dqblk),
- v1_dqoff(from_kqid(&init_user_ns, dquot->dq_id)));
+ v1_dqoff(from_kqid(dq_user_ns, dquot->dq_id)));
v1_disk2mem_dqblk(&dquot->dq_dqb, &dqblk);
if (dquot->dq_dqb.dqb_bhardlimit == 0 &&
@@ -79,6 +80,7 @@ static int v1_read_dqblk(struct dquot *dquot)
static int v1_commit_dqblk(struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
short type = dquot->dq_id.type;
ssize_t ret;
struct v1_disk_dqblk dqblk;
@@ -95,7 +97,7 @@ static int v1_commit_dqblk(struct dquot *dquot)
if (sb_dqopt(dquot->dq_sb)->files[type])
ret = dquot->dq_sb->s_op->quota_write(dquot->dq_sb, type,
(char *)&dqblk, sizeof(struct v1_disk_dqblk),
- v1_dqoff(from_kqid(&init_user_ns, dquot->dq_id)));
+ v1_dqoff(from_kqid(dq_user_ns, dquot->dq_id)));
if (ret != sizeof(struct v1_disk_dqblk)) {
quota_error(dquot->dq_sb, "dquota write failed");
if (ret >= 0)
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index ca71bf881ad1..54e27b296656 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -199,6 +199,7 @@ static void v2r0_disk2memdqb(struct dquot *dquot, void *dp)
static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
struct v2r0_disk_dqblk *d = dp;
struct mem_dqblk *m = &dquot->dq_dqb;
struct qtree_mem_dqinfo *info =
@@ -212,7 +213,7 @@ static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot)
d->dqb_bsoftlimit = cpu_to_le32(v2_stoqb(m->dqb_bsoftlimit));
d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
d->dqb_btime = cpu_to_le64(m->dqb_btime);
- d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
+ d->dqb_id = cpu_to_le32(from_kqid(dq_user_ns, dquot->dq_id));
if (qtree_entry_unused(info, dp))
d->dqb_itime = cpu_to_le64(1);
}
@@ -225,7 +226,7 @@ static int v2r0_is_id(void *dp, struct dquot *dquot)
if (qtree_entry_unused(info, dp))
return 0;
- return qid_eq(make_kqid(&init_user_ns, dquot->dq_id.type,
+ return qid_eq(make_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id.type,
le32_to_cpu(d->dqb_id)),
dquot->dq_id);
}
@@ -252,6 +253,7 @@ static void v2r1_disk2memdqb(struct dquot *dquot, void *dp)
static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
{
+ struct user_namespace *dq_user_ns = dquot->dq_sb->s_user_ns;
struct v2r1_disk_dqblk *d = dp;
struct mem_dqblk *m = &dquot->dq_dqb;
struct qtree_mem_dqinfo *info =
@@ -265,7 +267,7 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
d->dqb_bsoftlimit = cpu_to_le64(v2_stoqb(m->dqb_bsoftlimit));
d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
d->dqb_btime = cpu_to_le64(m->dqb_btime);
- d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
+ d->dqb_id = cpu_to_le32(from_kqid(dq_user_ns, dquot->dq_id));
if (qtree_entry_unused(info, dp))
d->dqb_itime = cpu_to_le64(1);
}
@@ -278,7 +280,7 @@ static int v2r1_is_id(void *dp, struct dquot *dquot)
if (qtree_entry_unused(info, dp))
return 0;
- return qid_eq(make_kqid(&init_user_ns, dquot->dq_id.type,
+ return qid_eq(make_kqid(dquot->dq_sb->s_user_ns, dquot->dq_id.type,
le32_to_cpu(d->dqb_id)),
dquot->dq_id);
}
--
2.8.3
next prev parent reply other threads:[~2016-07-02 17:33 UTC|newest]
Thread overview: 134+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-02 17:18 [PATCH review 0/11] General unprivileged mount support Eric W. Biederman
2016-07-02 17:18 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 01/11] fs: Refuse uid/gid changes which don't map into s_user_ns Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 03/11] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
[not found] ` <20160702172035.19568-1-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-02 17:20 ` [PATCH review 02/11] userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 03/11] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 04/11] fs: Check for invalid i_uid in may_follow_link() Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 05/11] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 06/11] vfs: Don't modify inodes with a uid or gid unknown to the vfs Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 07/11] vfs: Don't create " Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 08/11] quota: Ensure qids map to the filesystem Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 09/11] quota: Handle quota data stored in s_user_ns Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
[not found] ` <20160702172035.19568-9-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-02 17:33 ` [PATCH v2 " Eric W. Biederman
2016-07-02 17:33 ` Eric W. Biederman [this message]
2016-07-02 17:33 ` Eric W. Biederman
[not found] ` <87mvm03pxy.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-04 9:11 ` Jan Kara
2016-07-04 9:11 ` Jan Kara
2016-07-05 14:48 ` Seth Forshee
[not found] ` <20160704091100.GD5200-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-05 14:48 ` Seth Forshee
2016-07-05 15:34 ` Eric W. Biederman
2016-07-05 15:34 ` Eric W. Biederman
[not found] ` <87d1msumhy.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-05 20:57 ` Dave Chinner
2016-07-05 20:57 ` Dave Chinner
2016-07-05 20:57 ` Dave Chinner
2016-07-05 21:28 ` Eric W. Biederman
2016-07-05 21:28 ` Eric W. Biederman
2016-07-05 21:28 ` Eric W. Biederman
[not found] ` <8737nnrcyy.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 6:35 ` Dave Chinner
2016-07-06 6:35 ` Dave Chinner
2016-07-06 8:25 ` Jan Kara
2016-07-06 8:25 ` Jan Kara
[not found] ` <20160706082545.GC14067-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 17:51 ` Eric W. Biederman
2016-07-06 17:51 ` Eric W. Biederman
2016-07-04 9:11 ` Jan Kara
2016-07-02 17:20 ` [PATCH " Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 10/11] evm: Translate user/group ids relative to s_user_ns when computing HMAC Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 11/11] fs: Update i_[ug]id_(read|write) to translate relative to s_user_ns Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 05/11] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 07/11] vfs: Don't create inodes with a uid or gid unknown to the vfs Eric W. Biederman
[not found] ` <20160702172035.19568-7-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-04 7:59 ` Jan Kara
2016-07-04 7:59 ` Jan Kara
[not found] ` <20160704075919.GA5200-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-05 14:55 ` Eric W. Biederman
2016-07-05 14:55 ` Eric W. Biederman
[not found] ` <87zipwxhgp.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 9:07 ` Jan Kara
2016-07-06 9:07 ` Jan Kara
[not found] ` <20160706090705.GE14067-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 15:37 ` Eric W. Biederman
2016-07-06 15:37 ` Eric W. Biederman
2016-07-06 15:37 ` Eric W. Biederman
2016-07-04 7:59 ` Jan Kara
2016-07-02 17:20 ` [PATCH review 08/11] quota: Ensure qids map to the filesystem Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 10/11] evm: Translate user/group ids relative to s_user_ns when computing HMAC Eric W. Biederman
2016-07-04 8:52 ` [PATCH review 0/11] General unprivileged mount support Jan Kara
[not found] ` <20160704085220.GC5200-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-04 16:27 ` Eric W. Biederman
2016-07-04 16:27 ` Eric W. Biederman
[not found] ` <87h9c52wsd.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 8:54 ` Jan Kara
2016-07-06 8:54 ` Jan Kara
[not found] ` <20160706085440.GD14067-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 13:54 ` Seth Forshee
2016-07-06 13:54 ` Seth Forshee
2016-07-06 14:22 ` Jan Kara
2016-07-06 14:22 ` Jan Kara
2016-07-06 14:46 ` Seth Forshee
2016-07-06 15:01 ` Eric W. Biederman
[not found] ` <20160706142255.GB21164-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 14:46 ` Seth Forshee
2016-07-06 15:01 ` Eric W. Biederman
2016-07-06 15:23 ` James Bottomley
2016-07-06 15:23 ` James Bottomley
[not found] ` <1467818630.2369.21.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2016-07-06 16:35 ` Eric W. Biederman
2016-07-06 16:35 ` Eric W. Biederman
2016-07-06 14:22 ` Jan Kara
2016-07-04 16:27 ` Eric W. Biederman
[not found] ` <87ziq03qnj.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-02 17:20 ` [PATCH review 01/11] fs: Refuse uid/gid changes which don't map into s_user_ns Eric W. Biederman
2016-07-04 8:52 ` [PATCH review 0/11] General unprivileged mount support Jan Kara
2016-07-06 13:44 ` Andy Lutomirski
2016-07-06 13:44 ` Andy Lutomirski
[not found] ` <CALCETrVof174gPCZnD2Z-RMjR-P=NcA0mYCU9ki6=o9hpFL-BA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-06 15:21 ` Eric W. Biederman
2016-07-06 15:21 ` Eric W. Biederman
2016-07-06 13:44 ` Andy Lutomirski
2016-07-06 14:01 ` Andy Lutomirski
2016-07-06 14:01 ` Andy Lutomirski
2016-07-06 15:19 ` Eric W. Biederman
2016-07-06 15:19 ` Eric W. Biederman
2016-07-06 14:01 ` Andy Lutomirski
2016-07-06 18:10 ` [PATCH review 0/12] General unprivileged mount support v2 Eric W. Biederman
2016-07-06 18:10 ` Eric W. Biederman
[not found] ` <874m82bptc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 18:12 ` [PATCH review 01/12] fs: Refuse uid/gid changes which don't map into s_user_ns Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 02/12] userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 03/12] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 04/12] fs: Check for invalid i_uid in may_follow_link() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 05/12] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 08/12] quota: Ensure qids map to the filesystem Eric W. Biederman
[not found] ` <20160706181212.16267-8-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-11 10:14 ` Jan Kara
2016-07-11 10:14 ` Jan Kara
[not found] ` <20160711101424.GH12410-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-11 18:12 ` Eric W. Biederman
2016-07-11 18:12 ` Eric W. Biederman
2016-07-11 18:12 ` Eric W. Biederman
[not found] ` <878tx8dowu.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-13 1:34 ` Dave Chinner
2016-07-13 1:34 ` Dave Chinner
2016-07-13 3:45 ` Dave Chinner
2016-07-13 3:45 ` Dave Chinner
2016-07-13 5:43 ` Jann Horn
2016-07-13 5:43 ` Jann Horn
2016-07-14 17:03 ` Eric W. Biederman
[not found] ` <20160713054358.GB28635-J1fxOzX/cBvk1uMJSBkQmQ@public.gmane.org>
2016-07-14 17:03 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 09/12] quota: Handle quota data stored in s_user_ns in quota_setxquota Eric W. Biederman
[not found] ` <20160706181212.16267-1-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-06 18:12 ` [PATCH review 02/12] userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 03/12] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 04/12] fs: Check for invalid i_uid in may_follow_link() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 05/12] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 06/12] vfs: Don't modify inodes with a uid or gid unknown to the vfs Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 07/12] vfs: Don't create " Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 08/12] quota: Ensure qids map to the filesystem Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 09/12] quota: Handle quota data stored in s_user_ns in quota_setxquota Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 10/12] dquot: For now explicitly don't support filesystems outside of init_user_ns Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
[not found] ` <20160706181212.16267-10-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-11 10:09 ` Jan Kara
2016-07-11 10:09 ` Jan Kara
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 11/12] evm: Translate user/group ids relative to s_user_ns when computing HMAC Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 12/12] fs: Update i_[ug]id_(read|write) to translate relative to s_user_ns Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mvm03pxy.fsf_-_@x220.int.ebiederm.org \
--to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
--cc=James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jack-AlSwsSmVLrQ@public.gmane.org \
--cc=jannh-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=seth.forshee-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
--cc=tixxdz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.