All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, dchinner@redhat.com
Subject: Re: [PATCH 2/2 v2] fs: Fix hang with BSD accounting on frozen filesystem
Date: Mon, 12 Nov 2012 16:43:27 +1100	[thread overview]
Message-ID: <20121112054327.GR24575@dastard> (raw)
In-Reply-To: <1352378498-30625-2-git-send-email-jack@suse.cz>

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 <nikola.ciprich@linuxbox.cz>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  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 <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2012-11-12  5:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08 12:41 [PATCH 1/2 v2] fs: Return EAGAIN when O_NONBLOCK write should block on frozen fs Jan Kara
2012-11-08 12:41 ` [PATCH 2/2 v2] fs: Fix hang with BSD accounting on frozen filesystem Jan Kara
2012-11-12  5:43   ` Dave Chinner [this message]
2012-11-10  9:23 ` [PATCH 1/2 v2] fs: Return EAGAIN when O_NONBLOCK write should block on frozen fs Marco Stornelli
2012-11-12  5:42 ` Dave Chinner
2012-11-12 10:45   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121112054327.GR24575@dastard \
    --to=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.