All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Behrens <sbehrens@giantdisaster.de>
To: miaox@cn.fujitsu.com
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 4/5] Btrfs: cancel the scrub when remounting a fs to ro
Date: Mon, 21 May 2012 12:29:27 +0200	[thread overview]
Message-ID: <4FBA1907.3020800@giantdisaster.de> (raw)
In-Reply-To: <4FB9D3CD.8010303@cn.fujitsu.com>

On Mon, 21 May 2012 13:34:05 +0800, Miao Xie wrote:
> On Fri, 18 May 2012 14:52:07 +0200, David Sterba wrote:
>> On Thu, May 17, 2012 at 07:58:21PM +0800, Miao Xie wrote:
>>> --- a/fs/btrfs/super.c
>>> +++ b/fs/btrfs/super.c
>>> @@ -1151,6 +1151,8 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
>>>  		/* pause restriper - we want to resume on remount to r/w */
>>>  		btrfs_pause_balance(root->fs_info);
>>>  
>>> +		btrfs_scrub_cancel(root);
>>
>> Can we possibly switch scrub to readonly instead ? I'm not sure what's
>> the 'least surprise here', whether to cancel everything on the
>> filesystem upon ro-remount or just the minimal set of operations (and
>> leave the rest running if possible).
> 
> I don't think it is better to switch scrub to readonly soundlessly, because
> it is not the operation that the users expect if they don't choose the readonly
> mode.

Since David put me on CC for this thread, I state my humble opinion:
If I manually remount read-only, I would expect that scrub is switched
into read-only mode as well, not canceled. Plus a log message about this
change.


> BTW, I think we needn't cancel the readonly scrub on the filesystem upon ro-remount.
> 
> Thanks
> Miao
> 
>>
>> Looking at the scrub code, if dev->readonly is set, no repairs are done,
>> so the only concern is to wait for any outstanding IOs and then switch
>> to RO.
>>
>>
>> david

  reply	other threads:[~2012-05-21 10:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 11:58 [PATCH 4/5] Btrfs: cancel the scrub when remounting a fs to ro Miao Xie
2012-05-18 12:52 ` David Sterba
2012-05-21  5:34   ` Miao Xie
2012-05-21 10:29     ` Stefan Behrens [this message]
2012-05-21 10:29     ` Arne Jansen

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=4FBA1907.3020800@giantdisaster.de \
    --to=sbehrens@giantdisaster.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.fujitsu.com \
    /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.