linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: Lukas Czerner <lczerner@redhat.com>,
	linux-ext4@vger.kernel.org, tytso@mit.edu, sandeen@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: Make blkdev_issue_discard() interruptible
Date: Wed, 15 Sep 2010 18:16:10 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1009151815190.3162@dhcp-lab-213.englab.brq.redhat.com> (raw)
In-Reply-To: <AANLkTinmJyJOqgSe6G0RiNUgT59wtxeT6y+0b3GivQem@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1622 bytes --]

On Wed, 15 Sep 2010, Mike Snitzer wrote:

> On Wed, Sep 15, 2010 at 10:32 AM, Lukas Czerner <lczerner@redhat.com> wrote:
> > Since the discard may take quite long time, especially with really big
> > extents (like the whole device for example), it would be nice to give to
> > users the opportunity to abort it. This is especially useful for mkfs,
> > when user can not know in advance how long it will take.
> >
> > In conjunction with mke2fs patch "Inform user about ongoing discard"
> > it gives the user all the comfort of being informed about discard and
> > being able to abort the operation.
> >
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> > ---
> >  block/blk-lib.c |    5 +++++
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/block/blk-lib.c b/block/blk-lib.c
> > index d0216b9..4f54a1a 100644
> > --- a/block/blk-lib.c
> > +++ b/block/blk-lib.c
> > @@ -102,6 +102,11 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
> >                else if (!bio_flagged(bio, BIO_UPTODATE))
> >                        ret = -EIO;
> >                bio_put(bio);
> > +
> > +               if (signal_pending(current)) {
> > +                       ret = -ERESTARTSYS;
> > +                       break;
> > +               }
> >        }
> >        return ret;
> >  out_free_page:
> 
> Neil Brown recently suggested the use of fatal_signal_pending() rather
> than signal_epnding() in another thread:
> http://lkml.org/lkml/2010/9/12/232
> 
> I think Neil's suggestion applies here too?
> 
> Mike

Good to know, thanks a lot. I'll resend the patch shortly.

-Lukas

  reply	other threads:[~2010-09-15 16:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15 14:32 [PATCH] block: Make blkdev_issue_discard() interruptible Lukas Czerner
2010-09-15 14:59 ` Mike Snitzer
2010-09-15 16:16   ` Lukas Czerner [this message]
2010-09-15 16:23     ` [PATCH v2] " Lukas Czerner
  -- strict thread matches above, loose matches on Subject: below --
2010-10-21 14:34 [PATCH] " Lukas Czerner
2010-10-21 15:54 ` Lukas Czerner
2010-10-21 16:52   ` Jeff Moyer
2010-10-22 11:06     ` Lukas Czerner

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=alpine.LFD.2.00.1009151815190.3162@dhcp-lab-213.englab.brq.redhat.com \
    --to=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=snitzer@redhat.com \
    --cc=tytso@mit.edu \
    /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).