From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: [PATCH 2/3] fs: Fix hang with BSD accounting on frozen filesystem Date: Sat, 22 Dec 2012 02:07:16 +0100 Message-ID: <1356138437-8874-3-git-send-email-jack@suse.cz> References: <1356138437-8874-1-git-send-email-jack@suse.cz> Cc: linux-fsdevel@vger.kernel.org, Jan Kara To: Al Viro Return-path: Received: from cantor2.suse.de ([195.135.220.15]:49223 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750956Ab2LVBHZ (ORCPT ); Fri, 21 Dec 2012 20:07:25 -0500 In-Reply-To: <1356138437-8874-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 Reviewed-by: Dave Chinner 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); -- 1.7.1