summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* 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>
* Btrfs-progs: update btrfs_file_extent_inline_len to match kernel versionFilipe David Borba Manana2014-04-11
| | | | | | | | | | | | | | | | | | | | | | | The following kernel commit changed the definition of the inline function btrfs_file_extent_inline_len(): commit 514ac8ad8793a097c0c9d89202c642479d6dfa34 Author: Chris Mason <clm@fb.com> Date: Fri Jan 3 21:07:00 2014 -0800 Btrfs: don't use ram_bytes for uncompressed inline items If we truncate an uncompressed inline item, ram_bytes isn't updated to reflect the new size. The fixe uses the size directly from the item header when reading uncompressed inlines, and also fixes truncate to update the size as it goes. Not having this new definition implies that the restore tool might misbehave when restoring files with an inline extent that got truncated on a kernel older than release 3.14. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: restore, for compressed extents don't read more bytes than neededFilipe David Borba Manana2014-04-11
| | | | | | | | | | | | | | | | | | | | | | | We need to read a number of bytes corresponding to the disk size of the file extent item, and not to the number of bytes in the num_bytes field. Normally disk_size is smaller than num_bytes (when using compression), except for files created with lzo compression in a kernel older then the one which introduced the following change: commit 59516f6017c589e7316418fda6128ba8f829a77f Author: Stefan Agner <stefan@agner.ch> Date: Mon Jul 1 20:33:39 2013 +0200 Btrfs: return -1 when lzo compression makes data bigger With this fix the lzo code behaves like the zlib code by returning an error code when compression does not help reduce the size of the file. This is currently not a bug since the compressed size is checked again in the calling method compress_file_range. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Make property work with -t optionKusanagi Kouichi2014-04-11
| | | | | | | | | | | | | | | # btrfs prop list -t f . btrfs property list: too many arguments ... # btrfs prop get -t f . label btrfs property get: too many arguments ... # btrfs prop set -t f . label abc btrfs property set: too many arguments ... Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Constify gettersKusanagi Kouichi2014-04-11
| | | | | Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: btrfs: remove dead code in handle_optionsRakesh Pandit2014-04-11
| | | | | | | Just cleanup: remove useless return type, while loop and dead code. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Modify the help string to keep consistent with man page.Qu Wenruo2014-04-11
| | | | | | | | | Help string of "btrfs dev scan" is inconsistent with man page, which lacks the fact that -d|--all-device is conflict with <device>. This patch fixes the description Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fsck: fix wrong index in pick_next_pending()Wang Shilong2014-04-11
| | | | | | | | Though all tree blocks have same size, we'd better use right index here. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fsck: reduce memory usage of extent record structWang Shilong2014-04-11
| | | | | | | | | Two changes: 1.use bit filed for @found_rec 2.u32 is enough to calculate duplicate extent number. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fsck: fix possible memory leaks in run_next_block()Wang Shilong2014-04-11
| | | | | | | We still need free allocated cache memory in case error happens. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: fsck: don't free @seen cache until we finish searchingWang Shilong2014-04-11
| | | | | | | | @seen cache is used to avoid iterating same block more than once, and we can not free them until we have finished searching. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>