* PRJQUOTA case not handled in need_print_warning()
@ 2012-10-04 22:34 Jiri Kosina
2012-10-09 21:42 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2012-10-04 22:34 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: linux-kernel, Dave Chinner, Jan Kara
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.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PRJQUOTA case not handled in need_print_warning()
2012-10-04 22:34 PRJQUOTA case not handled in need_print_warning() Jiri Kosina
@ 2012-10-09 21:42 ` Jan Kara
2012-10-09 22:05 ` Eric W. Biederman
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2012-10-09 21:42 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Eric W. Biederman, linux-kernel, Dave Chinner, Jan Kara
[-- 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: PRJQUOTA case not handled in need_print_warning()
2012-10-09 21:42 ` Jan Kara
@ 2012-10-09 22:05 ` Eric W. Biederman
0 siblings, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2012-10-09 22:05 UTC (permalink / raw)
To: Jan Kara; +Cc: Jiri Kosina, linux-kernel, Dave Chinner
Jan Kara <jack@suse.cz> writes:
> 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.
Sorry about that. I knew there was no functional regression as the
functional part of the code had not changed. I was waiting for a my
head to have a clear moment where I could look through and see if
PRJQUOTA could ever make it there.
Having just made the time to look at it and see that this all goes
to dquot_alloc_space and is not related to the more general
quota_send_warning path I agree that in practice we will never get there
with a PRJQUOTA as xfs is the only filesystem that supports project
quotas and xfs does not call dquot_alloc_space.
If another filesytem were to support project quotas and used the dquot
infrastructure it is theoretically possible to reach need_warning
with a project quota. But even in that theoretical case since project
quotas identifiers do not attach themselves to tasks it looks like
ignoring them is the right thing to do.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-09 22:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04 22:34 PRJQUOTA case not handled in need_print_warning() Jiri Kosina
2012-10-09 21:42 ` Jan Kara
2012-10-09 22:05 ` Eric W. Biederman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox