From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH 2/2 v2] fs: Fix hang with BSD accounting on frozen filesystem Date: Mon, 12 Nov 2012 16:43:27 +1100 Message-ID: <20121112054327.GR24575@dastard> References: <1352378498-30625-1-git-send-email-jack@suse.cz> <1352378498-30625-2-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , linux-fsdevel@vger.kernel.org, dchinner@redhat.com To: Jan Kara Return-path: Received: from ipmail04.adl6.internode.on.net ([150.101.137.141]:14549 "EHLO ipmail04.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851Ab2KLFn3 (ORCPT ); Mon, 12 Nov 2012 00:43:29 -0500 Content-Disposition: inline In-Reply-To: <1352378498-30625-2-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Nov 08, 2012 at 01:41:38PM +0100, Jan Kara wrote: > When BSD process accounting is enabled and logs information to a filesystem > which gets frozen, system easily becomes unusable because each attempt to > account process information blocks. Thus e.g. every task gets blocked in exit. > > It seems better to drop accounting information (which can already happen when > filesystem is running out of space) instead of locking system up. So we > open the accounting file with O_NONBLOCK. > > Reported-and-tested-by: Nikola Ciprich > Signed-off-by: Jan Kara > --- > kernel/acct.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/kernel/acct.c b/kernel/acct.c > index 051e071..a061116 100644 > --- a/kernel/acct.c > +++ b/kernel/acct.c > @@ -201,7 +201,8 @@ static int acct_on(struct filename *pathname) > struct bsd_acct_struct *acct = NULL; > > /* Difference from BSD - they don't do O_APPEND */ > - file = file_open_name(pathname, O_WRONLY|O_APPEND|O_LARGEFILE, 0); > + file = file_open_name(pathname, > + O_WRONLY|O_APPEND|O_LARGEFILE|O_NONBLOCK, 0); > if (IS_ERR(file)) > return PTR_ERR(file); Looks good. Reviewed-by: Dave Chinner -- Dave Chinner david@fromorbit.com