summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* 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>
* btrfs-progs: Convert man page for btrfs-replace.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-replace. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert and enhance the man page of btrfs-qgroup.Qu Wenruo2014-04-22
| | | | | | | | | | Convert and enhance the man page of btrfs-qgroup. The original man page for btrfs-qgroup subcommand is almost useless for new user(like me), so adds more information on it. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-quota.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-quota. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-receive.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-receive. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-send.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-send. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-inspect-internalQu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-inspect-internal. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-rescueQu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-rescue. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-check.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-check. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-scrubQu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-scrub. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for btrfs-device subcommand.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-device 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-balance.Qu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-balance. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Convert man page for filesystem subcommand.Qu Wenruo2014-04-22
| | | | | | | Convert man page for filesystem 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-subvolumeQu Wenruo2014-04-22
| | | | | | | Convert man page for btrfs-subvolume. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Introduce asciidoc based man page and btrfs man page.Qu Wenruo2014-04-22
| | | | | | | | | | | | | | | The old man page of btrfs will grow larger with new functions adding to btrfs-progs and harder to maintain because the reader-unfriendly roff grammar and one LARGE btrfs.in. This patch will introduce the simplified Documentation directory mainly 'stolen' from git and include the first man page for 'btrfs(8)'. This time, man page will be written in human-friendly asciidoc grammar and each commands of btrfs will have a separate man page, which I hope can reduce the effort to maintain the man page. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* v3.14.1Chris Mason2014-04-18
| | | | Signed-off-by: Chris Mason <clm@fb.com>
* btrfs-progs: correct prompt of minimal num of devs for raid56Gui Hecheng2014-04-11
| | | | | | | | | For btrfs, Raid5 can't go below 2 devs, not 3; Raid6 can't go below 3 devs, not 4. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>