summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: use check_argc_exact to check arg number of btrfs-rescueGui Hecheng2014-08-22
| | | | | | | The btrfs-rescue accepts exactly one arg for both chunk-recover & super-recover, use check_argc_exact clearly. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add sys_chunk_array and backup roots info to show-superGui Hecheng2014-08-22
| | | | | | | | | Add sys chunk array and backup roots info if the new option '-f' if specified. This may be useful for debugging sys_chunk related issues. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Remove unneeded assert in find_good_parent().Qu Wenruo2014-08-22
| | | | | | | | | | | | find_good_parent() uses assert to deal with the problem that clone source's parent can't be found. But in fact the assert is somewhat overkilled since subvol_uuid_search() has enough error messages for debug and caller of find_good_parent() can handle the problems in find_good_parent(), so the assert can be removed without any problem. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Replace the overkill assert with normal error message.Qu Wenruo2014-08-22
| | | | | | | | | When 'btrfs replace status' encounters an unknown dev replace status, it will cause an assert, which is somewhat overkilled and can be replaced with a normal error message. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Improve the errno string about open_path_or_dev_mnt()Qu Wenruo2014-08-22
| | | | | | | | | | | | | | | open_path_or_dev_mnt() is used to on *mounted* btrfs device or mount point, when a unmounted btrfs device is passed, errno is set to EINVAL to info the caller. If ignore the errno and just print "ERROR: can't access '%s'", end users will get confused. This patch will add check for open_path_or_dev_mnt() caller and print more meaningful error message when a unmounted btrfs device path is given. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* v3.14.2Chris Mason2014-05-29
| | | | Signed-off-by: Chris Mason <clm@fb.com>
* scrub: fix uninit return variable in scrub_progress_cycleChris Mason2014-05-28
| | | | Signed-off-by: Chris Mason <clm@fb.com>
* btrfs-progs: doc: update the Availability sectionDavid Sterba2014-05-19
| | | | | | | Does not reflect the current state. The wiki contains more details on the first page. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: doc: make all commands and subcommands boldDavid Sterba2014-05-19
| | | | | | | Italic format is used for parameters and values. also this makes the text visually separated, Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: doc: autoformat user-supplied arguments by sedDavid Sterba2014-05-19
| | | | | | | Convert all values enclosed between <...> to italic before it goes to asciidoc processor. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: doc: remove text for unmerged featuresDavid Sterba2014-05-19
| | | | | | | The asciidoc conversion was done on a development branch and there are portions of text that do not reflect the code. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: doc: fix argument notation and typosDavid Sterba2014-05-19
| | | | | | | All user-supplied values should be enclosed in <...> to distinguish them from verbatim strings. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix mkfs.btrfs segfault with --features optionHolger Hoffstätte2014-05-02
| | | | | | | | | | The mkfs.btrfs --features long option takes an argument but does not declare it. Consequently getopt does not allocate an argument, which makes an unconditional strdup() crash during options parsing. Fix by declaring the argument in the options alias array. Signed-off-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: mkfs: remove ununsed parametersRakesh Pandit2014-05-02
| | | | | | | Remove ununsed parameters since 71d6bd3c in create_raid_groups. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: set string end sing '\0' for propertyLiu Bo2014-05-02
| | | | | | | | | | | Set string "xattr_name" 's end with '\0' so that it won't be violated in memory. With this fix, xfstest/btrfs/048 can pass on my box. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: Filipe Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: prevent close_root if the root to close is potentially NULLGui Hecheng2014-05-02
| | | | | | | | | | Originally only if 'block_only' is specified, the 'fs_root == NULL' will be checked. But if 'block_only' is not specified and close_root will be called blindly without checking 'fs_root == NULL', which is unsafe. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: move arg_strtou64 to a separate file for libraryDavid Sterba2014-05-02
| | | | | | | | | | Linking with libbtrfs fails because arg_strtou64 is not defined and we cannot just add utils.o to library objects because it's not library-clean. Reported-by: Arvin Schnell <aschnell@suse.com> Reported-by: Anton Farygin <rider@altlinux.org> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add dev maxs limit for btrfs_alloc_chunk in user spaceGui Hecheng2014-05-02
| | | | | | | | | | | For RAID0,5,6,10, For system chunk, there shouldn't be too many stripes to make a btrfs_chunk that exceeds BTRFS_SYSTEM_CHUNK_ARRAY_SIZE For data/meta chunk, there shouldn't be too many stripes to make a btrfs_chunk that exceeds a leaf. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix wrong max system array size check in user spaceGui Hecheng2014-05-02
| | | | | | | | | | For system chunk array, We copy a "disk_key" and an chunk item each time, so there should be enough space to hold both of them, not only the chunk item. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: mkfs: Remove 'zero_end =1' since it has been set to a valueLi Yang2014-05-02
| | | | | | | | | In utils.c, zero_end is used as a parameter, should not force it to 1. In mkfs.c, zero_end is set to 1 or 0(-b) at the beginning, should not force it to 1 unconditionally. Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fsck: fix double free memory crashRakesh Pandit2014-05-02
| | | | | | | | | | | | Fix double free of memory if btrfs_open_devices fails: *** Error in `btrfs': double free or corruption (fasttop): 0x000000000066e020 *** Crash happened because when open failed on device inside btrfs_open_devices it freed all memory by calling btrfs_close_devices but inside disk-io.c we call btrfs_close_again it again. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: make smatch checker happy (trivial fixes)Rakesh Pandit2014-05-02
| | | | | | | | | | | | | It complains errno never gets assigned to zero in find-root and since errno anyway is zero at program started up, lets remove it. Check "copy is less then zero" isn't possible because strtoull used by arg_strtou64 wouldn't return -ve number. Trivial space fixes. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: receive: remove return type of close_inode_for_writeRakesh Pandit2014-05-02
| | | | | | | | "close_inode_for_write" always returns 0, so just remove its return value and remove dead checking in caller. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fsck: while checking root refs print readable errorsRakesh Pandit2014-05-02
| | | | | | | | | Lets use "errors" instead of "error" because more then one ref errors are possible. Also print error messages for unresolved refs in check_root_refs. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: allow compression property gets for read-only subvolumesFilipe David Borba Manana2014-05-02
| | | | | | | | | | | | Because the function open_file_or_dir() always opened the input file in read/write mode (O_RDWR), we were not able to due a compression property get against a file living in a read-only subvolume/snapshot. Fix this by opening the file with O_RDONLY mode if we're doing a property get. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fix check to test trim supportRakesh Pandit2014-05-02
| | | | | | | | It was added in 25d82d22 but broke recently in 4724d7b0 while making discard interruptible. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Fix the return value when executing 'btrfs prop get' on an ↵Qu Wenruo2014-04-22
| | | | | | | | | | | | | | uncompressed file When executing 'btrfs prop get' on a file which is not compressed, return value will always be 50 since prop_compress() return -ENOATTR. But the codes have already check the errno to avoid unnecessary error message, so the return value should also set to 0. Signed-off-by: Qu Wenruo <quwenro@cn.fujitsu.com> Reviewed-by: Filipe Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Fix the return value of btrfs_scan_kernel()Qu Wenruo2014-04-22
| | | | | | | | | | | | | | btrfs_scan_kernel() is only used in 'btrfs fi show' but returns wrong return value. When search parameter is passed, it will never return 0 even the search can be matched. This patch will change the whatever strange logic to a more easy to understand one using 'found' var. Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Cc: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: chunk_recovery: fix mem leak and pthread_cancel callRakesh Pandit2014-04-22
| | | | | | | | | | | | | Free memory if open call fails. Prevent pthread_cancel on threads which have already finished successfully. If all calls to pthread_create and pthread_join are successful, we mistakenly call pthread_cancel because cancel_from and cancel_to are both zero. Make POSIX.1-2001 happy by supplying a non-NULL second argument to pthread_setcanceltype. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: scrub: disable thread cancelability during mutex locksRakesh Pandit2014-04-22
| | | | | | | | | | | | | | | | scrub_progress_cycle thread runs in asynchronous type but locks mutex while reading shared data. This patch disables cancelability for a brief time while locks are on so as to make sure they are unlocked before thread is canceled. scrub_write_progress gets called from scrub_progress_cycle in asynchronous thread but cancelability is disabled after mutex is locked. This patch moves the call to set cancelability type before mutex lock and makes corresponding changes to labels for error handling. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: remove unsed pthread attribute objectsRakesh Pandit2014-04-22
| | | | | | | | | Threads always use default attributes in all tools, so pthread attribute objects and their initializations are of no use. Just pass NULL as attr attribute to pthread_create for default attributes. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: btrfs-image: don't call pthread_join on IDs not presentRakesh Pandit2014-04-22
| | | | | | | | | | | | | | | | If pthread_create fails in mdrestore_init, then number of threads created could be less then num of threads option. Hence pass number of successful pthread_create calls to mdrestore_destroy, so that we don't call pthread_join on IDs not present when pthread_create fails. metadump_init already had this fixed, but repeats code from metadump_destroy. Reuse metadump_destroy by passing number of threads created (successful pthread_create calls) and save repeated cleaup code. Had to move metadump_destroy before metadump_init for obvious reasons. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: doc: link btrfsck to btrfs-checkDavid Sterba2014-04-22
| | | | | | | The 'btrfsck' command has been deprecated in favor of 'btrfs check'. For compatibility install a symlink to the btrfs-check.8 manpage. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add separate make target to clean docsDavid Sterba2014-04-22
| | | | | | | | Regenerating the asciidoc takes much longer now and makes quick build tests long. There's separate clean-doc target for that and clean-all that cleans docs and sources. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add btrfs wiki reference to man pages.Qu Wenruo2014-04-22
| | | | | | | | Add btrfs wiki page reference to btrfs-check/btrfsck, btrfs-restore and btrfs-device as supplement. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-property.Qu Wenruo2014-04-22
| | | | | | | Convert the man page for the newly added btrfs-property subcommand. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-restore.Qu Wenruo2014-04-22
| | | | | | | | Convert man page for btrfs-restore, which I forgot to convert in the previous patchset. :P Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add explain on btrfs-zero-log.Qu Wenruo2014-04-22
| | | | | | | | Add more explain on btrfs-zero-log about when to use it. Reviewed-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add device management related paragraph.Qu Wenruo2014-04-22
| | | | | | | | | Add device management related paragraph to better explain btrfs device management. Cc: Marc MERLIN <marc@merlins.org> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Switch to the new asciidoc Documentation.Qu Wenruo2014-04-22
| | | | | | | | Since all man page are converted to the new asciidoc, the old man page can be removed. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for mkfs.btrfs.Qu Wenruo2014-04-22
| | | | | | | Convert man page for mkfs.btrfs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for fsck.btrfs.Qu Wenruo2014-04-22
| | | | | | | Convert man page for fsck.btrfs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-zero-logQu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-zero-log Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfstune.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfstune. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-show-super.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-show-super. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-map-logical.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-map-logical. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-image.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-image. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-find-root.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-find-root. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-debug-tree.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-debug-tree. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-convert.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-convert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>