summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: remove btrfs-show-super manual page and point to inspect-internalDavid Sterba2016-03-15
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: update dump-superDavid Sterba2016-03-15
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: rename and move dump-superDavid Sterba2016-03-15
| | | | | | | The command name is 'dump-super', move the section to it's alphabetical order. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-super: add more long optionsDavid Sterba2016-03-15
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-super: switch to getopt_longDavid Sterba2016-03-15
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix resource leak during device scanningDavid Sterba2016-03-15
| | | | | | | The dev info is leaked each time we find a known filesystem. Resolves-coverity-id: 1127098 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: utils: switch more error messages to common helpersDavid Sterba2016-03-14
| | | | | | Functions relatd to device changes/status/open, mount checks. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: improve error messages after failed wipingDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Introduce device delete by devidAnand Jain2016-03-14
| | | | | | | | | | | | | | | | | | | | | | | | This patch introduces new option <devid> for the command btrfs device delete <device_path|devid>[..] <mnt> In a user reported issue on a 3-disk-RAID1, one disk failed with its SB unreadable. Now with this patch user will have a choice to delete the device using devid. The other method we could do, is to match the input device_path to the available device_paths with in the kernel. But that won't work in all the cases, like what if user provided mapper path when the path within the kernel is a non-mapper path. This patch depends on the below kernel patch for the new feature to work, however it will fail-back to the old interface for the kernel without the patch Btrfs: Introduce device delete by devid Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: fix more typos and spelling errorsDavid Sterba2016-03-14
| | | | | | With help of ispell. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: fix spelling errorsAlexander Fougner2016-03-14
| | | | | Signed-off-by: Alexander Fougner <fougner89@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Avoid interpreting options after "--" when getting unit modeSatoru Takeuchi2016-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | * actual result ====================================== # ./btrfs device usage -- -m /btrfs /dev/sdf1, ID: 1 Device size: 95367.41MiB Data,single: 2056.00MiB Metadata,DUP: 2048.00MiB System,DUP: 16.00MiB Unallocated: 91247.41MiB ====================================== * expected result ====================================== # ./btrfs device usage -- -m /btrfs ERROR: can't access '-m': No such file or directory ====================================== Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix a regression that btrfs filesystem label doesn't workSatoru Takeuchi2016-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The number of arguments which is allowed to pass became wrong from the following commit. commit 176aeca9a148c5e29de0 ("btrfs-progs: add getopt stubs where needed") * actual result =========================================================== # ./btrfs prop get /btrfs label label=foo # ./btrfs fi label /btrfs btrfs filesystem label: too few arguments 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 to <newlabel>. # ./btrfs fi label /btrfs bar foo # ./btrfs prop get /btrfs label label=foo =========================================================== * expected result =========================================================== # ./btrfs prop get /btrfs label label=foo # ./btrfs fi label /btrfs foo # ./btrfs fi label /btrfs bar # ./btrfs prop get /btrfs label label=bar =========================================================== Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: show the compression method stringWang Xiaoguang2016-03-14
| | | | | | Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> [ changed the format of unknown value ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix device scan to interpret its argument properlySatoru Takeuchi2016-03-14
| | | | | | | | | | | | | | | | | | | Fix the following bug. ================================ # btrfs device scan -- /dev/sdb ERROR: not a block device: -- ================================ It should work as follow. ================================ # ./btrfs device scan -- /dev/sdb Scanning for Btrfs filesystems in '/dev/sdb' ================================ Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Dont' stop scanning of devices at first failed deviceYauhen Kharuzhy2016-03-14
| | | | | | | | | | | | | | | | | | | | | | When 'btrfs device scan' command is invoked, it scans all devices, check them for btrfs superblock and add devices with btrfs to a list. Next, each device from the list is passed to kernel where it is handled in the btrfs_scan_one_device() function. This function can, for example, return -EBUSY when device contains superblock matched to existing and mounted filesystem (if this device was pulled out from RAID and connected again after some time). btrfs tool stops device scan if any device has been failed to add, so other existing devices with (possibly) valid FS will never be reached. Fix this by remove stopping at any failure in the btrfs_register_all_devices(), just return error count. btrfs_scan_one_device() reports any kind of error already. Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@zavadatar.com> [ initialize err to 0 ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove btrfs-debug-tree manual page and point to inspect-internalDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: let --tree understand name of the treeDavid Sterba2016-03-14
| | | | | | | For practical purposes teach -t about the human readable names of the trees in addition to the numerical id. The name syntax is flexible. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: update dump-treeDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print version information earlierDavid Sterba2016-03-14
| | | | | | | The version information could be useful addition to the dump, print it before we attempt to open the filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print tree keys with -eDavid Sterba2016-03-14
| | | | | | | The incomplete tree description is printed with -e, glued to the leaf information. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Describe device scan -d is a deprecated option in manpageSatoru Takeuchi2016-03-14
| | | | | | | | | It's already marked as deprecated in cmd_device_scan_usage(). commit 5444864e5605 ("btrfs-progs: remove BTRFS_SCAN_PROC scan method") Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Replace hardcoded PAGE_CACHE_SIZE with sectorsize.Feifei Xu2016-03-14
| | | | | | | | | PAGE_CACHE_SIZE is hardcoded to 4K in cmds-restore.c. Correct value should be sector size. Fix this through replacing hardcoded 4K to sectorsize. Signed-off-by: Feifei Xu <xufeifei@linux.vnet.ibm.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: unify naming of long option valuesDavid Sterba2016-03-14
| | | | | | We use GETOP_VAL_ . Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: update check optionsDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: drop short option for --chunk-treeDavid Sterba2016-03-14
| | | | | | | The need to specify the chunk root is not that common, we will reserve the short option -c for later use. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add new option for specify chunk root bytenrLu Fengqi2016-03-14
| | | | | | | | | | Add new btrfsck option, '--chunk-root', to specify chunk root bytenr. And allow open_ctree_fs_info() function accept chunk_root_bytenr to override the bytenr in superblock. This will be mainly used when chunk tree corruption. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix broken 'device scan' arguments parsingYauhen Kharuzhy2016-03-14
| | | | | | | | | Commit 52179e4fea41e55f31c92cd033a0b53a5107b4f4 'btrfs-progs: unify argc min/max checking' breaks 'btrfs device scan' command when no argument was given. Fix this. Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@zavadatar.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: unify argc min/max checking, a few moreDavid Sterba2016-03-14
| | | | | | We don't want to modify argc. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: util: Fix a wrong unit of pretty_sizeQu Wenruo2016-03-14
| | | | | | | | | | | | | | | | | If parameter for pretty_size is smaller than default base(1024), pretty_size() will output wrong unit. For example, pretty_size(1008) will output '0.98B' not '1008B' or '0.98KiB'. The cause is, for default base and auto-detect unit, base will be 1024 but num_divs is still 0, last result will still be divided by base, causing the bug. Fix it by checking num_divs in default case, and if num_divs is 0, change base to 1. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add image for bko#96971 (bad checksum type)David Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: libbtrfs: remove max/min macros from APIOndrej Kozina2016-03-14
| | | | | | | | | kerncompat.h header file is part of libbtrfs API. min/max macros cause conflict while building projects dependant on libbtrfs. Moving those macros to btrfs-progs internal header file fixes the conflict. Signed-off-by: Ondrej Kozina <okozina@redhat.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: document -O|--features flagVytas Dauksa2016-03-14
| | | | | | | Copy-pasted description found at mkfs.btrfs. I did not bother with feature list as it seemed to be incomplete. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: don't print message for a missing deviceDavid Sterba2016-03-14
| | | | | | | | | | | The message "warning devid %llu not found already\n", does not seem to be too useful, it appears during several commands and sometimes repeatedly. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: restore: update error messagesDavid Sterba2016-03-14
| | | | | | Switch to common helpers, message wording changed. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: switch more error messages to common helpersDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix misc/005-long-device-name-for-ssdDavid Sterba2016-03-14
| | | | | | | | We use a device mapper device on top of a loop device, the change in rotational status does not always propagate if change it at the loop device sysfs node. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: inspect: remove unnecessary helpersDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: unify argc min/max checkingDavid Sterba2016-03-14
| | | | | | We don't want to modify argc. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: unify naming of argc and argvDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: rename commandline helpersDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add getopt stubs where neededDavid Sterba2016-03-14
| | | | | | | | | Commands that do not take any options do not use getopt, which means the standard option separator "--" does not work. Update all command handlers that need it, argv needs to be referenced using the optind that is correctly pointed after the separator. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: add note about resizing to max after device replaceAlexander Fougner2016-03-14
| | | | | | Signed-off-by: Alexander Fougner <fougner89@gmail.com> [ formatting adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: add long options for unitsDavid Sterba2016-03-14
| | | | | | Drop -h, add just the common long options for now. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: switch to u64David Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: Calculate space shared by each directory arguments file setMark Fasheh2016-03-14
| | | | | | | | | | | | | | Here we define each file set as those found by a recursive search of a single directory argument to btrfs fi du. This isn't as simple as adding up shared extents - they may be shared with each other, and may also overlap. This patch uses an interval tree to store shared extents we find while fiemapping files. After collecting them, a 'set shared' count is calculated by summing (without overlap) each shared region discovered. This is then displayed to the user as 'set shared'. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: filesystem: add 'du' commandMark Fasheh2016-03-14
| | | | | | | | | | | | | | | | | 'btrfs du' differs from regular du in that it will work to resolve which blocks are shared between files in its list. This gives the user a more accurate bytecount from which they can make decisions regarding management of their file space. We still print a total number of bytes counted (like regular du), but also print the number of bytes which were found to have been shared amongst the file set provided. From there it becomes trivial to calculate how much space is exclusively owned. Signed-off-by: Mark Fasheh <mfasheh@suse.de> [ rename files to reflect the filesystem command group, add GPL v2 file headers ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: extend per-binary objectsDavid Sterba2016-03-14
| | | | | | | | | The standalone utilities could share object files with the main utility, add a way to specify additional object files in a similar way to the extra libs. The variable name must match the binary plus _objects suffix and s/-/_/ . Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update docs for inspect-internal dump-superAlexander Fougner2016-03-14
| | | | | | Signed-off-by: Alexander Fougner <fougner89@gmail.com> [ minor formatting updates ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: introduce inspect-internal dump-superAlexander Fougner2016-03-14
| | | | | | | | The long-term plan is to merge the features of standalone tools into the btrfs binary, reducing the number of shipped binaries. Signed-off-by: Alexander Fougner <fougner89@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>