After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741211 - Remove unnecessary duplicate actions when resizing a partition
Remove unnecessary duplicate actions when resizing a partition
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2014-12-07 11:13 UTC by Mike Fleetwood
Modified: 2015-01-26 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove unnecessary duplicate steps when resizing (v1) (7.81 KB, patch)
2014-12-07 11:26 UTC, Mike Fleetwood
none Details | Review
Remove unnecessary duplicate steps when resizing (v2) (7.84 KB, patch)
2014-12-07 17:03 UTC, Mike Fleetwood
none Details | Review

Description Mike Fleetwood 2014-12-07 11:13:54 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
Comment 1 Mike Fleetwood 2014-12-07 11:26:53 UTC
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
Comment 2 Mike Fleetwood 2014-12-07 17:03:47 UTC
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
Comment 3 Mike Fleetwood 2014-12-12 23:44:45 UTC
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
Comment 4 Curtis Gedak 2014-12-13 17:48:50 UTC
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
Comment 5 Curtis Gedak 2014-12-13 18:45:01 UTC
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
Comment 6 Curtis Gedak 2015-01-26 18:27:02 UTC
This enhancement was included in the GParted 0.21.0 release on January 26, 2015.