linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dave Chinner <david@fromorbit.com>
Cc: Jan Kara <jack@suse.cz>, Al Viro <viro@ZenIV.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Subject: Re: [PATCH] fs: Fix hang with BSD accounting on frozen filesystem
Date: Thu, 8 Nov 2012 11:18:04 +0100	[thread overview]
Message-ID: <20121108101804.GA20482@quack.suse.cz> (raw)
In-Reply-To: <20121108052256.GM6434@dastard>

On Thu 08-11-12 16:22:56, Dave Chinner wrote:
> On Wed, Nov 07, 2012 at 11:31:39PM +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. This is
> > implemented using a special flag FMODE_NO_FREEZE_WAIT in file->f_mode of a
> > file to which accounting information is written.
> 
> I have no problems with making freeze waiting non-blocking, by why
> invent a new flag for what is essentially an O_NONBLOCK operation?
> 
> Indeed, if someone opens a file O_NONBLOCK, shouldn't if behave
> exactly the same on a frozen filesystem as this special
> FMODE_NO_FREEZE_WAIT flag?
  Originally I didn't want to cause user visible effects for other files
with the fix. But you are right that O_NONBLOCK means exactly what we need
and userspace could actually expect something like this to work. I'm
somewhat worried about broken applications which don't expect EAGAIN from
O_NONBLOCK write to a file (as traditionally O_NONBLOCK was no-op for
buffered file writes) but I guess it's worth a try. Thanks for idea, I'll
send an updated patch shortly.
 
> FWIW, nfsd could use this as well so that it doesn't block all the
> nfsd threads trying to write to a frozen filesystem but instead
> returns EJUKEBOX to the client to tell it ot wait for a while before
> trying the operation again...
  Yes, that would be another possible use of O_NONBLOCK.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      parent reply	other threads:[~2012-11-08 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 22:31 [PATCH] fs: Fix hang with BSD accounting on frozen filesystem Jan Kara
2012-11-08  5:22 ` Dave Chinner
2012-11-08  8:09   ` Marco Stornelli
2012-11-08 10:18   ` Jan Kara [this message]

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=20121108101804.GA20482@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nikola.ciprich@linuxbox.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).