aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-09-16 05:32:43 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-09-18 04:01:40 -0400
commit431f19744d15531825cdbc8e771b43854b0d005b (patch)
tree1c8927533fad647a9aab4f1e00030ce6bd20bf15 /fs/gfs2/quota.c
parent74a8a103789465c4e67f38d1abb5cea770002601 (diff)
userns: Convert quota netlink aka quota_send_warning
Modify quota_send_warning to take struct kqid instead a type and identifier pair. When sending netlink broadcasts always convert uids and quota identifiers into the intial user namespace. There is as yet no way to send a netlink broadcast message with different contents to receivers in different namespaces, so for the time being just map all of the identifiers into the initial user namespace which preserves the current behavior. Change the callers of quota_send_warning in gfs2, xfs and dquot to generate a struct kqid to pass to quota send warning. When all of the user namespaces convesions are complete a struct kqid values will be availbe without need for conversion, but a conversion is needed now to avoid needing to convert everything at once. Cc: Ben Myers <bpm@sgi.com> Cc: Alex Elder <elder@kernel.org> Cc: Dave Chinner <david@fromorbit.com> Cc: Jan Kara <jack@suse.cz> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index b3115392d68..d554dfff58e 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1070,8 +1070,10 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid)
1070 1070
1071 if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) { 1071 if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) {
1072 print_message(qd, "exceeded"); 1072 print_message(qd, "exceeded");
1073 quota_send_warning(test_bit(QDF_USER, &qd->qd_flags) ? 1073 quota_send_warning(make_kqid(&init_user_ns,
1074 USRQUOTA : GRPQUOTA, qd->qd_id, 1074 test_bit(QDF_USER, &qd->qd_flags) ?
1075 USRQUOTA : GRPQUOTA,
1076 qd->qd_id),
1075 sdp->sd_vfs->s_dev, QUOTA_NL_BHARDWARN); 1077 sdp->sd_vfs->s_dev, QUOTA_NL_BHARDWARN);
1076 1078
1077 error = -EDQUOT; 1079 error = -EDQUOT;
@@ -1081,8 +1083,10 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid)
1081 time_after_eq(jiffies, qd->qd_last_warn + 1083 time_after_eq(jiffies, qd->qd_last_warn +
1082 gfs2_tune_get(sdp, 1084 gfs2_tune_get(sdp,
1083 gt_quota_warn_period) * HZ)) { 1085 gt_quota_warn_period) * HZ)) {
1084 quota_send_warning(test_bit(QDF_USER, &qd->qd_flags) ? 1086 quota_send_warning(make_kqid(&init_user_ns,
1085 USRQUOTA : GRPQUOTA, qd->qd_id, 1087 test_bit(QDF_USER, &qd->qd_flags) ?
1088 USRQUOTA : GRPQUOTA,
1089 qd->qd_id),
1086 sdp->sd_vfs->s_dev, QUOTA_NL_BSOFTWARN); 1090 sdp->sd_vfs->s_dev, QUOTA_NL_BSOFTWARN);
1087 error = print_message(qd, "warning"); 1091 error = print_message(qd, "warning");
1088 qd->qd_last_warn = jiffies; 1092 qd->qd_last_warn = jiffies;