From: Chris Samuel <chris@csamuel.org>
To: Mike Fleetwood <mike.fleetwood@googlemail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: Don't error on resizing FS to same size
Date: Fri, 18 Nov 2011 15:52:00 +1100 [thread overview]
Message-ID: <4EC5E470.4030605@csamuel.org> (raw)
In-Reply-To: <20111117210433.GA1817@gmail.com>
On 18/11/11 08:04, Mike Fleetwood wrote:
> It seems overly harsh to fail a resize of a btrfs file system to the
> same size when a shrink or grow would succeed. User app GParted trips
> over this error. Allow it by bypassing the shrink or grow operation.
OK - I'm a newbie with the code (and I'm looking at Linus's current git
rather than any dev tree of Chris's), but...
> Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
> ---
[...]
> ---
> fs/btrfs/ioctl.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index dae5dfe..00b7024 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -1251,7 +1251,7 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root,
> }
> ret = btrfs_grow_device(trans, device, new_size);
> btrfs_commit_transaction(trans, root);
> - } else {
> + } else if (new_size > old_size) {
shouldn't that be:
+ } else if (new_size < old_size) {
otherwise you'll never try and shrink if new_size is < old_size..
> ret = btrfs_shrink_device(device, new_size);
> }
>
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
next prev parent reply other threads:[~2011-11-18 4:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 21:04 [PATCH] Btrfs: Don't error on resizing FS to same size Mike Fleetwood
2011-11-18 4:52 ` Chris Samuel [this message]
2011-11-18 8:14 ` Mike Fleetwood
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=4EC5E470.4030605@csamuel.org \
--to=chris@csamuel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=mike.fleetwood@googlemail.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.