[gparted] Stop checking for 'btrfs filesystem label' support (!26)



commit 0b5cfd3496c1fc88334cfeb87237a61225c118d1
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Tue Mar 12 15:05:12 2019 +0000

    Stop checking for 'btrfs filesystem label' support (!26)
    
    btrfs-progs 3.12 includes 'btrfs filesystem label /dev/PTN NEWLABEL'
    functionality so stop checking for this before enabling setting the
    label.
    
        $ btrfs version
        Btrfs v3.12
        $ btrfs filesystem label --help
        usage: btrfs filesystem label [<device>|<mount_point>] [<newlabel>]
    
            Get or change the label of a filesystem
    
            With one argument, get the label of filesystem on <device>.
            If <newlabel> is passed, set the filesystem label on <newlabel>.
    
        $ echo $?
        0
    
    Worst case scenario is that some how an old version of the btrfs command
    is used which doesn't support the labelling functionality.  Then this
    commit would change GParted from disallowing labelling of a btrfs, to
    allowing it, but presumably it would fail with an error from the btrfs
    command reporting so.  Arguably better from a support point of view.
    
    Closes !26 - Remove support for btrfs-progs < 3.12

 src/btrfs.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/btrfs.cc b/src/btrfs.cc
index fd4c77d7..9b70817f 100644
--- a/src/btrfs.cc
+++ b/src/btrfs.cc
@@ -56,6 +56,7 @@ FS btrfs::get_filesystem_support()
                // Use these btrfs multi-tool sub-commands without further checking for
                // their availability:
                //     btrfs check
+               //     btrfs filesystem label
                //     btrfs filesystem resize
                //     btrfs filesystem show
                // as they are all available in btrfs-progs >= 3.12.
@@ -64,6 +65,7 @@ FS btrfs::get_filesystem_support()
                fs .read_label = FS::EXTERNAL ;
                fs .read_uuid = FS::EXTERNAL ;
                fs.check = FS::EXTERNAL;
+               fs.write_label = FS::EXTERNAL;
 
                //Resizing of btrfs requires mount, umount and kernel
                //  support as well as btrfs filesystem resize
@@ -77,10 +79,6 @@ FS btrfs::get_filesystem_support()
                        if ( fs .read ) //needed to determine a minimum file system size.
                                fs .shrink = FS::EXTERNAL ;
                }
-
-               //Test for labelling capability in btrfs command
-               if ( ! Utils::execute_command( "btrfs filesystem label --help", output, error, true ) )
-                       fs .write_label = FS::EXTERNAL;
        }
 
        if ( ! Glib::find_program_in_path( "btrfstune" ).empty() )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]