From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 1/3] RFC quota: add generic quota error handlers. Date: Tue, 6 Apr 2010 19:35:14 +0200 Message-ID: <20100406173514.GC4420@quack.suse.cz> References: <1270026037-22187-1-git-send-email-dmonakhov@openvz.org> <20100331145407.GB3322@quack.suse.cz> <8739zaxi32.fsf@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-fsdevel@vger.kernel.org To: Dmitry Monakhov Return-path: Received: from cantor2.suse.de ([195.135.220.15]:55018 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756620Ab0DFRfG (ORCPT ); Tue, 6 Apr 2010 13:35:06 -0400 Content-Disposition: inline In-Reply-To: <8739zaxi32.fsf@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > >> diff --git a/fs/quota/quota.c b/fs/quota/quota.c > >> index 95388f9..ebdce30 100644 > >> --- a/fs/quota/quota.c > >> +++ b/fs/quota/quota.c > >> @@ -19,6 +19,41 @@ > >> #include > >> #include > >> > >> +static void quota_handle_error(struct super_block *sb) > >> +{ > >> + > >> + set_bit(_DQUOT_ERROR, &sb_dqopt(sb)->flags); > >> + /* XXX: Currently it is no impossible to signall fs about error */ > >> +} > > I guess we can make all quota allocation and freeing functions to return > > an error (EIO) if they spot some problem. That should be enough for a > > filesystem to find out something is wrong... > This result significant paradigm changes, because almost all fs-related > syscalls result int quota alloc/free which return -EIO (i.e in almost > unusable filesystem). Users with incorrect system-scripts will hate us > for this. You're right, it's not so simple. But your notification function is IMHO an overengineering. So I'd stick to passing the fact that quota is probably corrupted via a function return value. We might use some less "fatal" error code than EIO or even return a positive return value (because usually quota operation itself happened just fine, we only spotted some quota inconsistency). Then we have to update every filesystem using quotas to count with the fact that quota functions can return such return value. Probably have a simple wrapper for each filesystem for those 4 quota function it calls which will filter-out the special return value and do whatever else it wishes to do... Maybe if there are several filesystems that want to just ignore quota corruption, we can create generic wrappers just filtering out the special return value. Honza -- Jan Kara SUSE Labs, CR