gfs2: Introduce new quota=quiet mount option
This patch adds a new mount option quota=quiet which is the same as quota=on but it suppresses gfs2 quota error messages. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
parent
267d1a011e
commit
eef46ab713
4 changed files with 16 additions and 6 deletions
|
@ -537,6 +537,7 @@ struct gfs2_statfs_change_host {
|
||||||
#define GFS2_QUOTA_OFF 0
|
#define GFS2_QUOTA_OFF 0
|
||||||
#define GFS2_QUOTA_ACCOUNT 1
|
#define GFS2_QUOTA_ACCOUNT 1
|
||||||
#define GFS2_QUOTA_ON 2
|
#define GFS2_QUOTA_ON 2
|
||||||
|
#define GFS2_QUOTA_QUIET 3 /* on but not complaining */
|
||||||
|
|
||||||
#define GFS2_DATA_DEFAULT GFS2_DATA_ORDERED
|
#define GFS2_DATA_DEFAULT GFS2_DATA_ORDERED
|
||||||
#define GFS2_DATA_WRITEBACK 1
|
#define GFS2_DATA_WRITEBACK 1
|
||||||
|
|
|
@ -1396,6 +1396,7 @@ static const struct constant_table gfs2_param_quota[] = {
|
||||||
{"off", GFS2_QUOTA_OFF},
|
{"off", GFS2_QUOTA_OFF},
|
||||||
{"account", GFS2_QUOTA_ACCOUNT},
|
{"account", GFS2_QUOTA_ACCOUNT},
|
||||||
{"on", GFS2_QUOTA_ON},
|
{"on", GFS2_QUOTA_ON},
|
||||||
|
{"quiet", GFS2_QUOTA_QUIET},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1083,7 +1083,8 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
|
||||||
u32 x;
|
u32 x;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
|
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
|
||||||
|
sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error = gfs2_quota_hold(ip, uid, gid);
|
error = gfs2_quota_hold(ip, uid, gid);
|
||||||
|
@ -1202,10 +1203,11 @@ static int print_message(struct gfs2_quota_data *qd, char *type)
|
||||||
{
|
{
|
||||||
struct gfs2_sbd *sdp = qd->qd_sbd;
|
struct gfs2_sbd *sdp = qd->qd_sbd;
|
||||||
|
|
||||||
fs_info(sdp, "quota %s for %s %u\n",
|
if (sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET)
|
||||||
type,
|
fs_info(sdp, "quota %s for %s %u\n",
|
||||||
(qd->qd_id.type == USRQUOTA) ? "user" : "group",
|
type,
|
||||||
from_kqid(&init_user_ns, qd->qd_id));
|
(qd->qd_id.type == USRQUOTA) ? "user" : "group",
|
||||||
|
from_kqid(&init_user_ns, qd->qd_id));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1291,7 +1293,8 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
|
||||||
u32 x;
|
u32 x;
|
||||||
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
|
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
|
||||||
|
|
||||||
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON ||
|
if ((sdp->sd_args.ar_quota != GFS2_QUOTA_ON &&
|
||||||
|
sdp->sd_args.ar_quota != GFS2_QUOTA_QUIET) ||
|
||||||
gfs2_assert_warn(sdp, change))
|
gfs2_assert_warn(sdp, change))
|
||||||
return;
|
return;
|
||||||
if (ip->i_diskflags & GFS2_DIF_SYSTEM)
|
if (ip->i_diskflags & GFS2_DIF_SYSTEM)
|
||||||
|
@ -1601,6 +1604,8 @@ static int gfs2_quota_get_state(struct super_block *sb, struct qc_state *state)
|
||||||
memset(state, 0, sizeof(*state));
|
memset(state, 0, sizeof(*state));
|
||||||
|
|
||||||
switch (sdp->sd_args.ar_quota) {
|
switch (sdp->sd_args.ar_quota) {
|
||||||
|
case GFS2_QUOTA_QUIET:
|
||||||
|
fallthrough;
|
||||||
case GFS2_QUOTA_ON:
|
case GFS2_QUOTA_ON:
|
||||||
state->s_state[USRQUOTA].flags |= QCI_LIMITS_ENFORCED;
|
state->s_state[USRQUOTA].flags |= QCI_LIMITS_ENFORCED;
|
||||||
state->s_state[GRPQUOTA].flags |= QCI_LIMITS_ENFORCED;
|
state->s_state[GRPQUOTA].flags |= QCI_LIMITS_ENFORCED;
|
||||||
|
|
|
@ -1119,6 +1119,9 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
|
||||||
case GFS2_QUOTA_ON:
|
case GFS2_QUOTA_ON:
|
||||||
state = "on";
|
state = "on";
|
||||||
break;
|
break;
|
||||||
|
case GFS2_QUOTA_QUIET:
|
||||||
|
state = "quiet";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
state = "unknown";
|
state = "unknown";
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue