summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* btrfs-progs: docs: update formatting and wording for btrfs(5)David Sterba2017-04-20
| | | | | | | - emphasize features in the list - minor whitespace fixes Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: add validation to print_chunkLu Fengqi2017-04-20
| | | | | | | | | | | In print_chunk, validate the value of uuid_offset when read the dev_uuid of stripe. Was triggered by misc-test/015-dump-super-garbage running indefinetelly. Issue: #37 Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-super: check array_size in print_sys_chunk_arrayLu Fengqi2017-04-20
| | | | | | | | Without validation of array_size, the dump-super may lead to a bad memory access. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: send: always print a space after path in dumpEvan Danaher2017-04-19
| | | | | | | | | | | | | | | | | | | | | I was shocked to discover that 'btrfs receive --dump' doesn't print a space after long filenames, so it runs together into the metadata; for example: truncate ./20-00-03/this-name-is-32-characters-longsize=0 This is a trivial patch to add a single space unconditionally, so the result is the following: truncate ./20-00-03/this-name-is-32-characters-long size=0 I suppose this is technically a breaking change, but it seems unlikely to me that anyone would depend on the existing behavior given how unfriendly it is. Signed-off-by: Evan Danaher <github@edanaher.net> Reviewed-by: Noah Massey <noah.massey@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: misc-tests: Superblock corruption and recovery using backupLakshmipathi.G2017-04-19
| | | | | Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: Fix newlines for man btrfstuneHans van Kranenburg2017-04-19
| | | | | | | | | | | | A bunch of newlines were missing, which resulted in only -S and -r to show as option after xmlto is used to convert the documentation to a man page. The rest of the options would end up being appended to the explanation of -r. Signed-off-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: balance: minor wording adjustment for full balance warningDavid Sterba2017-04-19
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: Fix missing newline in man 5 btrfsHans van Kranenburg2017-04-19
| | | | | | | | The text compress_lzo:: would show up directly after 'bigger than the page size' on the same line. Signed-off-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: misc/018-receive use receive -e to terminate on end markerChristian Brauner2017-04-19
| | | | | | Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> [ enhance tests to take extra options and use for -e ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix btrfs send & receive with -e flagChristian Brauner2017-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | The old check here tried to ensure that empty streams are not considered valid. The old check however, will always fail when only one run through the while(1) loop is needed and honor_end_cmd is set. So this: btrfs send /some/subvol | btrfs receive -e /some/ will consistently fail because -e causes honor_cmd_to be set and btrfs_read_and_process_send_stream() to correctly return 1. So the command will be successful but btrfs receive will error out because the send - receive concluded in one run through the while(1) loop. If we want to exclude empty streams we need a way to tell the difference between btrfs_read_and_process_send_stream() returning 1 because read_buf() did not detect any data and read_and_process_cmd() returning 1 because honor_end_cmd was set. Without introducing too many changes the best way to me seems to have btrfs_read_and_process_send_stream() return -ENODATA in the first case. The rest stays the same. We can then check for -ENODATA in do_receive() and report a proper error in this case. This should also be backwards compatible to previous versions of btrfs receive. They will fail on empty streams because a negative value is returned. The only thing that they will lack is a nice error message. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: btrfs-replace, fix typoDavid Sterba2017-04-07
| | | | | | | Github pull request #39, from gabo77. Author: 3psus <gabo77@me.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: README: sort bug reports means by preferenceDavid Sterba2017-04-07
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: rework option parser to use getopt for global optionsDavid Sterba2017-03-31
| | | | | | | | | Preparatory work to support more global options. The current parser abuses the subcommand table to understand help and version when specified as options (--). These are now special case when processing the global options. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: mount options, enhance ssd/nossdDavid Sterba2017-03-31
| | | | | Reported-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com> Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.10.2David Sterba2017-03-31
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.10.2David Sterba2017-03-31
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix missing __error symbol in libbtrfs.so.0Sergei Trofimovich2017-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | The easiest way to reproduce the error is to try to build btrfs-progs with $ make LDFLAGS=-Wl,--no-undefined btrfs-list.o: In function `lookup_ino_path': btrfs-list.c:(.text+0x7d2): undefined reference to `__error' Noticed by Denis Descheneaux when snapper tool stopped working after upgrade to btrfs-progs-4.10. As soname didn't change in 4.9 -> 4.10 release I assume it's just an object file omission in library depends and not the API/ABI change of the library error printing. Cc: linux-btrfs@vger.kernel.org Cc: Mike Gilbert <floppym@gentoo.org> Reported-by: Denis Descheneaux Bug: https://bugs.gentoo.org/show_bug.cgi?id=613890 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add SHARED_DATA_REF test image for check lowmem modeQu Wenruo2017-03-31
| | | | | | | | | | | | | | Introduce a new image, which contains external SHARED_DATA_REF items to trigger a lowmem mode false alert. The image only contains external SHARED_DATA_REF and no inlined data backref. Before the image, we only have inlined shared data ref, which is not enough to trigger lowmem mode false alert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: lowmem, fix false alert about backref lost for ↵Qu Wenruo2017-03-31
| | | | | | | | | | | | | | | | SHARED_DATA_REF In check_extent_data_item(), after checking extent item of one data extent, we search inlined data backref, then EXTENT_DATA_REF_KEY. But we didn't search SHARED_DATA_REF, so if the backref is SHARED_DATA_REF, then we will raise a false alert about backref lost. Fix by also checking SHARED_DATA_REF_KEY in check_extent_data_item(). Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Add missing return for HOLE mode when checking convert ↵Qu Wenruo2017-03-31
| | | | | | | | | | | | | | image In check_convert_image(), for normal HOLE case, if the file extents are smaller than image size, we set ret to -EINVAL and print error message. But forget to return. This patch adds the missing return to fix it. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add prefix to message helpersDavid Sterba2017-03-31
| | | | | | | | | The implementation of message helpers use very generic names so we should at least use a prefix, as they're going to be usied from within the library. The build fix will follow. Reported-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Cleanup kernel-shared dir when execute make cleanQu Wenruo2017-03-31
| | | | | | Reported-by: Chris <coderight@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library-test: add all exported headersDavid Sterba2017-03-31
| | | | | | | Explicitly include all headers exported to library, as a light build check that the files are really present. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.10.1David Sterba2017-03-17
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.10.1David Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Make btrfs_reserved_ranges constQu Wenruo2017-03-16
| | | | | | | | | | | | Since btrfs_reserved_ranges array is just used to store btrfs reserved ranges, no one will nor should modify them at run time, make them static and const will be better. This also eliminates the use of immediate number 3. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ definition stays in source-fs.c ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: kerncompat: Fix re-definition of __bitwiseQu Wenruo2017-03-16
| | | | | | | | | | | | In latest linux api headers, __bitwise is already defined in /usr/include/linux/types.h. So kerncompat.h will re-define __bitwise, and cause gcc warning. Fix it by checking if __bitwise is already define. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: Also output log root treeQu Wenruo2017-03-16
| | | | | | | | | | | In btrfs-dump-tree, we output any existing log tree, however we don't output the log root tree, which records all root items for log trees. This makes it confusing for any one who want to know where the log tree comes from. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: Fix duplicated output when using -t optionQu Wenruo2017-03-16
| | | | | | | | | | When using -t option to output trees not in root tree (chunk/root/log root), then we output the tree twice. Fix it Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: misc/019, use fssumDavid Sterba2017-03-16
| | | | | | The fssum utility is now ready to use, test still passes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, switch from MD5 to SHA256David Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add SHA256David Sterba2017-03-16
| | | | | | | | | | In order to drop dependency on SSL library to compute MD5 in fssum, we'll use the reference implementation from RFC 6234. The checksum is not in a cryptographically sensitive context, but we're going to skip MD5 and SHA-1 anyway. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, update includesDavid Sterba2017-03-16
| | | | | | Remove unneeded and add headers that define time_te and int types. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, drop *_SOURCE defines, already provided via config.hDavid Sterba2017-03-16
| | | | | | | | | | | | | In file included from /usr/include/stdio.h:27:0, from kerncompat.h:22, from tests/fssum.c:25: /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" ^~~~~~~ We've solved that long time ago and config.h now provides the macros. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, use our endianity helperDavid Sterba2017-03-16
| | | | | | | | The function htonll is not provided by the standard library and we can replace it by our cpu-to-XX helpers. This switches the endianity of the checksummed value to LE, but this is not a problem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, drop unnecessray build definesDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fssum utilityDavid Sterba2017-03-16
| | | | | | | | | | Copy from fstests, originally from git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git Needs libcrypto to link but this check is now missing in configure. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: cleanup use of IMAGE and replace by helpersDavid Sterba2017-03-16
| | | | | | | | Nearly each use of IMAGE can be replaced by common helpers as there are no specific requirements on the testing filesystem. There are still a few left that need to be evaluated and converted eventually. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: mkfs/002 and 003: use TEST_DEV instead of IMAGEDavid Sterba2017-03-16
| | | | | | As we don't know what's the TEST_DEV like, use the explicit mkfs limit. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: use TEST_DEV in cli-testsDavid Sterba2017-03-16
| | | | | | IMAGE points to the fallback image, tests should use TEST_DEV. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: add preliminary do's & dont's for testsDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: do test build of library-test.staticDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library-test: update test to build outside of topdirDavid Sterba2017-03-16
| | | | | | | | | | | | We need to build outside of the topdir so we can use the "btrfs/" prefix for includes and not accidentally include other files. Make magic is simple: - build dependencies inside TOPDIR - build inside temporary directory, link back to TOPDIR - library-test.o not built anymore obviously Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library-test: update header inclusionDavid Sterba2017-03-16
| | | | | | | The library-test is supposed to compile and link as an external program, so we should update the way the headers are included. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library: distribute sizes.h, fix buildDavid Sterba2017-03-16
| | | | | | | | | | | | | The patch "btrfs-progs: Introduce kernel sizes to cleanup large intermediate number" (a2203246ae483d09) was taken from kernel but not properly ported so the build breaks because the header linux/sizes.h is not exported. The build tests of library do not cover the case when the macro BTRFS_FLAT_INCLUDES is not defined (ie. an external build). Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add missing limits headersBaruch Siach2017-03-16
| | | | | | | Build under musl libc fails because of missing PATH_MAX and XATTR_NAME_MAX macro declarations. Add the required headers. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
* btrfs-progs: convert: Rework rollbackQu Wenruo2017-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework rollback to a more easy to understand way. New convert behavior makes us to have a more flex chunk layout, which only data chunk containing old fs data will be at the same physical location, while new chunks (data/meta/sys) can be mapped anywhere else. This behavior makes old rollback behavior can't handle it. As old behavior assumes all data/meta is mapped in a large chunk, which is mapped 1:1 on disk. So rework rollback to handle new convert behavior, enhance the check by only checking all file extents of convert image, only to check if these file extents and therir chunks are mapped 1:1. This new rollback check behavior can handle both new and old convert behavior, as the new behavior is a superset of old behavior. Further more, introduce a simple rollback mechanisim: 1) Read reserved data (offset = file offset) from convert image 2) Write reserved data into disk (offset = physical offset) Since old fs image is a valid fs, and we only need to rollback superblocks (btrfs reserved ranges), then we just read out data in reserved range, and write it back. Due to the fact that all other file extents of converted image is mapped 1:1 on disk, we put the missing piece back, then the fs is as good as old one. Then what we do in btrfs is just another dream. With this new rollback mechanisim, we can open btrfs read-only, so we won't cause any damage to current btrfs, until the final piece (0~1M, containing 1st super block) is put back. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ port to v4.10 ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Introduce function to check if convert image is able ↵Qu Wenruo2017-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | to be rolled back Introduce a function, check_convert_image() to check if that image is rollback-able. This means all file extents except one of the btrfs reserved ranges, must be mapped 1:1 on disk. 1:1 mapped file extents must match the following conditions: 1) Their file_offset(key.offset) matches its disk_bytenr 2) The corresponding chunk must be mapped 1:1 on disk That's to say, it's a SINGLE chunk, and chunk logical matches with stripe physical. Above 2 conditions ensured that file extent lies the exactly the same position as in the old filesystem. For data in reserved ranges of btrfs, they are relocated to new places, and in that case, we use btrfs_read_file() to read out the content for later rollback use. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: convert: Introduce function to read out btrfs reserved rangeQu Wenruo2017-03-16
| | | | | | | Introduce a new function, read_reserved_ranges(), to allow later rollback to use these data to do rollback. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: file: Introduce function to read out file contentQu Wenruo2017-03-16
| | | | | | | | | | | | | Introduce a new function, btrfs_read_file(), to read out data of a file inode. This function will iterate through EXTENT_DATA items and handle inline/prealloc/hole file extents. Compression is not supported yet. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>