All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Josef Bacik <josef@redhat.com>
Cc: Arne Jansen <sensille@gmx.net>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: don't return EINTR
Date: Wed, 18 Apr 2012 12:32:34 -0400	[thread overview]
Message-ID: <20120418163234.GF28915@shiny> (raw)
In-Reply-To: <20120418143611.GC1937@localhost.localdomain>

On Wed, Apr 18, 2012 at 10:36:11AM -0400, Josef Bacik wrote:
> On Wed, Apr 18, 2012 at 10:27:16AM +0200, Arne Jansen wrote:
> > It is basically a good thing if we are interruptible when waiting for
> > free space, but the generality in which it is implemented currently
> > leads to system calls being interruptible that are not documented this
> > way. For example git can't handle interrupted unlink(), leading to
> > corrupt repos under space pressure.
> > Instead we raise the bar to only be interruptible by SIGKILL.
> > Thanks to David Sterba for suggesting this.
> > 
> > Signed-off-by: Arne Jansen <sensille@gmx.net>
> > ---
> >  fs/btrfs/extent-tree.c |    9 +++------
> >  1 files changed, 3 insertions(+), 6 deletions(-)
> > 
> > diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> > index 2b35f8d..10d4bb7 100644
> > --- a/fs/btrfs/extent-tree.c
> > +++ b/fs/btrfs/extent-tree.c
> > @@ -3769,13 +3769,10 @@ again:
> >  		 */
> >  		if (current->journal_info)
> >  			return -EAGAIN;
> > -		ret = wait_event_interruptible(space_info->wait,
> > -					       !space_info->flush);
> > -		/* Must have been interrupted, return */
> > -		if (ret) {
> > -			printk(KERN_DEBUG "btrfs: %s returning -EINTR\n", __func__);
> > +		ret = wait_event_killable(space_info->wait, !space_info->flush);
> > +		/* Must have been killed, return */
> > +		if (ret)
> >  			return -EINTR;
> > -		}
> >  
> >  		spin_lock(&space_info->lock);
> >  	}
> 
> Ok I like this one,
> 
> Reviewed-by: Josef Bacik <josef@redhat.com>

Perfect.

-chris

      reply	other threads:[~2012-04-18 16:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18  8:27 [PATCH v2] btrfs: don't return EINTR Arne Jansen
2012-04-18 14:22 ` Arne Jansen
2012-04-18 14:36 ` Josef Bacik
2012-04-18 16:32   ` Chris Mason [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=20120418163234.GF28915@shiny \
    --to=chris.mason@oracle.com \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sensille@gmx.net \
    /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.