From: Jan Kara <jack@suse.cz>
To: Jiri Kosina <jkosina@suse.cz>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
Jan Kara <jack@suse.cz>
Subject: Re: PRJQUOTA case not handled in need_print_warning()
Date: Tue, 9 Oct 2012 23:42:27 +0200 [thread overview]
Message-ID: <20121009214227.GC27882@quack.suse.cz> (raw)
In-Reply-To: <alpine.LNX.2.00.1210050032220.3873@pobox.suse.cz>
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
On Fri 05-10-12 00:34:29, Jiri Kosina wrote:
> Hi,
>
> commit e8a3e4719b7ec19288c56f22623f537cb78885c1
> Author: Eric W. Biederman <ebiederm@xmission.com>
> Date: Sun Sep 16 01:11:45 2012 -0700
>
> userns: Implement struct kqid
>
> causes this warning:
>
> fs/quota/dquot.c: In function ‘need_print_warning’:
> fs/quota/dquot.c:1158: warning: enumeration value ‘PRJQUOTA’ not handled in switch
>
> and it seems to be a valid one -- the switch in need_print_warning()
> contains neither 'default' nor PRJQUOTA case handler.
Hum, since Eric didn't seem to care, I've fixed this up myself with the
attached patch. Actually, PRJQUOTA should never get to that function so it
shouldn't cause any problems in practice. Thanks for the report.
Honza
[-- Attachment #2: 0001-quota-Silence-warning-about-PRJQUOTA-not-being-handl.patch --]
[-- Type: text/x-patch, Size: 1015 bytes --]
>From 6c29c50fda25c2ac2ce45a9b042ff7e424aa8eac Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Tue, 9 Oct 2012 23:30:17 +0200
Subject: [PATCH] quota: Silence warning about PRJQUOTA not being handled in need_print_warning()
PRJQUOTA value of quota type should never reach need_print_warning() since XFS
(which is the only fs which uses that type) doesn't use generic functions
calling this function. Anyway, add PRJQUOTA case to the switch to make gcc
happy.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/quota/dquot.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 557a9c2..05ae3c9 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1160,6 +1160,8 @@ static int need_print_warning(struct dquot_warn *warn)
return uid_eq(current_fsuid(), warn->w_dq_id.uid);
case GRPQUOTA:
return in_group_p(warn->w_dq_id.gid);
+ case PRJQUOTA: /* Never taken... Just make gcc happy */
+ return 0;
}
return 0;
}
--
1.7.1
next prev parent reply other threads:[~2012-10-09 21:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-04 22:34 Jiri Kosina
2012-10-09 21:42 ` Jan Kara [this message]
2012-10-09 22:05 ` 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=20121009214227.GC27882@quack.suse.cz \
--to=jack@suse.cz \
--cc=david@fromorbit.com \
--cc=ebiederm@xmission.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®