On Fri 05-10-12 00:34:29, Jiri Kosina wrote:
> Hi,
> 
> commit e8a3e4719b7ec19288c56f22623f537cb78885c1
> Author: Eric W. Biederman <ebied...@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
>From 6c29c50fda25c2ac2ce45a9b042ff7e424aa8eac Mon Sep 17 00:00:00 2001
From: Jan Kara <j...@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 <j...@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

Reply via email to