GNOME Bugzilla – Bug 741211
Remove unnecessary duplicate actions when resizing a partition
Last modified: 2015-01-26 18:27:02 UTC
Noticed that while growing a partition the file system is checked twice, where as when shrinking a partition it is only checked once. Also noticed that shrinking a swap partition recreates swap twice, where as growing only recreates it once. Fix to follow shortly. Mike
Created attachment 292249 [details] [review] Remove unnecessary duplicate steps when resizing (v1) Hi Curtis, Here's a small patchset to fix these minor issues. Thanks, Mike
Created attachment 292252 [details] [review] Remove unnecessary duplicate steps when resizing (v2) Here's version 2 of the patchset with a few minor changes. P1) Updates commit summary P2) No change P3) Updates commit message Re-adds a blank line I didn't intend to remove, before final return in ::resize(). Thanks, Mike
Hi Curtis, Just noticed this spelling mistake in the commit message fo patch number 3. Can you correct (rebase and reword) before pushing upstream. "file system check stop to a successful no-op." ^ s/stop/step/ v "file system check step to a successful no-op." Thanks, Mike
Hi Mike, I am reviewing the patch set in comment 2, and have made the change suggested in comment 3. It looks like you caught some stuff that I missed when enhancing "move/copy linux-swap". Curtis
Hi Mike, The code looks good to me. I tested grow and shrink with and without moves using linux-swap and ext4 and also with both MiB and cylinder alignment and all went as expected. I also tested a check operation on an ntfs file system that was smaller than the partition. The operation correctly grew the ntfs file system to match the partition size. As you mentioned, a compound move and resize operation still performs unnecessary checks and recreates of linux-swap. Changing this behaviour is non-trivial because internally GParted treats the move and resize as separate operations. I think we might increase the complexity unnecessarily if we try to combine these operations. The patch set in comment 2 along with the change from comment 3 has been committed to the git repository for inclusion in the next release of GParted. The relevant commits can be viewed at the following links: Remove second file system check when growing a partition (#741211) https://git.gnome.org/browse/gparted/commit/?id=b4acb14ff11b2cf26721dc20ab466b82e8dcaa12 Stop recreating linux-swap twice when shrinking a partition (#741211) https://git.gnome.org/browse/gparted/commit/?id=99f770ddb0c14a3771a00499ccc30f2de76dc9a6 Refactor resize() to make it even easier to understand (#741211) https://git.gnome.org/browse/gparted/commit/?id=95ff4fbdc904889f1c593ad5bfecff7776a90618 Curtis
This enhancement was included in the GParted 0.21.0 release on January 26, 2015.