summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* mkfs.btrfs: return some defined value instead of garbage when lookup checksumSergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | ==31873== Command: ./mkfs.btrfs -r /some/root/ ==31873== Parent PID: 31872 ==31873== ==31873== Conditional jump or move depends on uninitialised value(s) ==31873== at 0x42C3D0: add_file_items (mkfs.c:792) ==31873== by 0x42CAB3: traverse_directory (mkfs.c:948) ==31873== by 0x42CF11: make_image (mkfs.c:1047) ==31873== by 0x42DE53: main (mkfs.c:1401) ==31873== Uninitialised value was created by a stack allocation ==31873== at 0x41B1B1: btrfs_csum_file_block (file-item.c:195) 'ret' value was not initialized for 'found' branch. The same fix sits in kernel: > commit 639cb58675ce9b507eed9c3d6b3335488079b21a > Author: Chris Mason <chris.mason@oracle.com> > Date: Thu Aug 28 06:15:25 2008 -0400 > > Btrfs: Fix variable init during csum creation > > Signed-off-by: Chris Mason <chris.mason@oracle.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: fail on scandir error (-r mode)Sergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | | | | | | | | mkfs.btrfs does not handle relative pathnames for now. When they are passed to it it creates empty image. So first time I thought it does not work at all. This patch adds error handling for scandir(). With patch it behaves this way: $ mkfs.btrfs -r ./root ... fs created label (null) on output.img nodesize 4096 leafsize 4096 sectorsize 4096 size 256.00MB Btrfs v0.19-52-g438c5ff-dirty scandir for ./root failed: No such file or directory unable to traverse_directory Making image is aborted. mkfs.btrfs: mkfs.c:1402: main: Assertion `!(ret)' failed. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-convert: fix typo: 'all inode' -> 'all inodes'Sergei Trofimovich2011-10-25
| | | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* make "btrfs filesystem label" command actually workFajar A. Nugraha2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simple patch makes "btrfs filesystem label" command actually work. On tmp branch, commit d1dc6a9, "btrfs filesystem label" functionality was introduced. However the commit lacks one component that lets "btrfs" accept "filesystem label" command. Test case: /dev/loop0 WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using fs created label old on /dev/loop0 nodesize 4096 leafsize 4096 sectorsize 4096 size 1.00GB Btrfs Btrfs v0.19 old new FATAL: the filesystem has to be unmounted new Not sure if you need if you need a signoff for something as trivial as this, but here it is just in case. Signed-off-by: Fajar A. Nugraha <list@fajar.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs progs: fix extra metadata chunk allocation in --mixed caseArne Jansen2011-10-25
| | | | | | | | | | | | | | | | | | | | When creating a mixed fs with mkfs, an extra metadata chunk got allocated. This is because btrfs_reserve_extent calls do_chunk_alloc for METADATA, which in turn wasn't able to find the proper space_info, as __find_space_info did a hard compare of the flags. It is now sufficient for the space_info to include the proper flag. This reflects the change done to the kernel code to support mixed chunks. Also for a subsequent chunk allocation (which should not be hit in the mkfs case), the chunk is now created with the flags from the space_info instead of the requested flags. A better solution would be to pull the full changeset for the mixed case from the kernel into the user mode (or, even better, share the code) The additional chunk probably confused block_rsv calculation, which in turn led to severeal ENOSPC Oopses. Signed-off-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* incorrect argument checking for "btrfs sub snap -r"Stephane Chazelas2011-10-25
| | | | | | | Looks like this was missing in integration-20110626 for the readonly snapshot patch: Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: Fix over-sized limit on bufferHugo Mills2011-10-25
| | | | | | | gcc-4.4 complains (rightly) that the strncpy has a limit too large for the array it's copying into. Use the correct array length. Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Updated manpage for btrfs subvolume snapshot.Andreas Philipp2011-10-25
| | | | | Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Test the additional ioctl.Andreas Philipp2011-10-25
| | | | | Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Support the new parameters in do_clone(int argc, char** argv).Andreas Philipp2011-10-25
| | | | | | | | Now 'btrfs subvolume snapshot' takes not two but only at least two parameters. Additionally, the help message is updated accordingly. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Add support for read-only subvolumes.Andreas Philipp2011-10-25
| | | | | | | | Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Added support for an additional ioctl.Andreas Philipp2011-10-25
| | | | | | | | Added BTRFS_IOC_SNAP_CREATE_V2 and struct btrfs_ioctl_vol_args_v2 as defined in fs/btrfs/ioctl.h in the kernel sources. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: cast u64 to long long to avoid printf warningsAnton Blanchard2011-10-25
| | | | | | | | | | | | When building on ppc64 I hit a number of warnings in printf: btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long unsigned int’, but argument 4 has type ‘u64’ Fix them. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Fix unused-but-set errors in gcc-4.6Chris Ball2011-10-25
| | | | | | | | | | | | | | | | gcc-4.6 (as shipped in Fedora) turns on -Wunused-but-set-variable by default, which breaks the build when combined with -Wall, e.g.: debug-tree.c: In function ‘print_extent_leaf’: debug-tree.c:45:13: error: variable ‘last_len’ set but not used [-Werror=unused-but-set-variable] debug-tree.c:44:13: error: variable ‘last’ set but not used [-Werror=unused-but-set-variable] debug-tree.c:41:21: error: variable ‘item’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors This patch fixes the errors by removing the unused variables. Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* add detailed help messages to btrfs commandHubert Kario2011-10-25
| | | | | | | | | | | | | | | | extend the btrfs <cmd> --help command to print detailed help message if available but fallback to basic help message if detailed is unavailable add detailed help message for 'filesystem defragment' command little tweaks in comments Signed-off-by: Hubert Kario <kario@wit.edu.pl> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* add advanced use of --help to help messageHubert Kario2011-10-25
| | | | | | | | | | | explain how to use btrfs <cmd> --help command in help message Signed-off-by: Hubert Kario <kario@wit.edu.pl> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs should initialize unused fields properlyJan Schmidt2011-10-25
| | | | | | | | | | | we discovered speed setting is (probably unintentionally) initialized to 1 in make_btrfs(), while being initialized to 0 in btrfs_add_to_fsid(). initialization in make_btrfs() is due to reuse of buf after pwrite() without clearing it. consequently, code like btrfs_set_extent_generation(buf, extent_item, 1); writes to the same location in buf where speed will be placed, later. It may be a good idea to clear buf after each pwrite(), though leaving the struct btrfs_header intact. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: setting of time to the root directoryTsutomu Itoh2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the setting of time to the root directory to the mkfs.btrfs command. As a result, the time of the mount point not correctly displayed comes to be displayed correctly. [before] # mkfs.btrfs /dev/sdd10 # mount /dev/sdd10 /test1 # ls -ld /test1 dr-xr-xr-x 1 root root 0 Jan 1 1970 /test1 [after] # date Tue Nov 16 18:06:05 JST 2010 # mkfs.btrfs /dev/sdd10 # mount /dev/sdd10 /test1 # ls -ld /test1 dr-xr-xr-x 1 root root 0 Nov 16 18:06 /test1 Thanks, Tsutomu Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: add discard support to mkfsChristoph Hellwig2011-10-25
| | | | | | | | Discard the whole device before starting to create the filesystem structures. Modelled after similar support in mkfs.xfs. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: fix wrong extent buffer size when reading tree blockMiao Xie2011-10-25
| | | | | | | | the root extent buffer of a tree may not be a leaf, so we must get the right size by its level when reading it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: Add new feature to mkfs.btrfs to make file system image file ↵Donggeun Kim2011-10-25
| | | | | | | | | | | | | | | | | | from source directory Changes from V1 to V2: - support extended attributes - move btrfs_alloc_data_chunk function to volumes.c - fix an execution error when additional useless parameters are specified - fix traverse_directory function so that the insertion functions for the common items are invoked in a single point The extended attributes is implemented through llistxattr and getxattr function calls. Thanks Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: Update man page for mixed data+metadata option.Mitch Harder2011-10-25
| | | | | | | Update the mkfs.btrfs man page for the -M option to mix data and metadata chunks. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add the "btrfs filesystem label" commandGoffredo Baroncelli2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi all, this patch adds the command "btrfs filesystem label" to change (or show) the label of a filesystem. This patch is a subset of the one written previously by Morey Roof. I included the user space part only. So it is possible only to change/show a label of a *single device* and *unounted* filesystem. The reason of excluding the kernel space part, is to simplify the patch in order to speed the check and then the merging of the patch itself. In fact I have to point out that in the past there was almost three attempts to propose this patch, without success neither complaints. Chris, let me know how you want to proceed. I know that you are very busy, and you prefer to work to stabilize btrfs instead adding new feature. But I think that changing a label is a *essential* feature for a filesystem managing tool. Think about a mount by LABEL. To show a label $ btrfs filesystem label <device> To set a label $ btrfs filesystem label <device> <newlabel> Please guys, give a look to the source. Comments are welcome. You can pull the source from the branch "label" of the repository http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git Regards G.Baroncelli Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Deprecate btrfsctl, btrfs-show, btrfs-volGoffredo Baroncelli2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi all, the patch below deprecates the following programs * btrfsctl * btrfs-vol * btrfs-show the reason is simple, these programs are superseded by the btrfs utility, both in terms of documentation, usability and bug. The goal is to avoid to duplicate codes and avoid update two programs. The patch adds a warning in the man pages, in the INSTALL file and in the programs. $ ./btrfsctl ** ** WARNING: this program is considered deprecated ** Please consider to switch to the btrfs utility ** no valid commands given usage: btrfsctl [ -d file|dir] [ -s snap_name subvol|tree ] [-r size] [-A device] [-a] [-c] [-D dir .] -d filename: defragments one file -d directory: defragments the entire Btree -s snap_name dir: creates a new snapshot of dir -S subvol_name dir: creates a new subvolume -r [+-]size[gkm]: resize the FS by size amount -A device: scans the device file for a Btrfs filesystem -a: scans all devices for Btrfs filesystems -c: forces a single FS sync -D: delete snapshot -m [tree id] directory: set the default mounted subvolume to the [tree id] or the directory Below the patch, but it is possible to pull the changes from: http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git branch btrfs-deprecated Comments are welcome. G.Baroncelli INSTALL | 5 +++++ btrfs-show.c | 5 +++++ btrfs-vol.c | 5 +++++ btrfsctl.c | 5 +++++ man/btrfs-show.8.in | 3 +++ man/btrfsctl.8.in | 3 +++ 6 files changed, 26 insertions(+), 0 deletions(-) the tool to create a new snapshot for the filesystem. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update/clean up btrfs help and man page V2Goffredo Baroncelli2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi all, enclose you can find a patch which improves the help of the btrfs commands, updates the INSTALL file and the btrfs (command) man page. Regarding the help of the btrfs command: - moved the "subvolume set-default" command in the "subvolume" commands group - removed a wrong new line - small tweak on the basis of Andreas suggestion Regarding the btrfs command man page: - renaming the command "device balance" in "filesystem balance" (thanks to Andreas Phillipp to highlight that) - adding the entry "subvolume find-new" - document the switches of the command "filesystem defrag" - document the <devid> facility of the command "filesystem resize" - small tweak on the basis of Andreas suggestion Regarding the INSTALL file, which was very old, I removed the reference of the old btrfsctl utility and changed the examples using the btrfs command. I removed the old (and now wrong) statement about the inability to delete a subvolume/snapshot Chris, you can pull the patch from the branch "help_cleanup" of the following repository. http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git (or you can browse the changes at http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git/?p=btrfs- progs-unstable-all.git;a=summary) The patch is very simple: only updates the man page, the INSTALL file and moves/updates some lines in the help of btrfs command. Comments are welcome. Regards G.Baroncelli INSTALL | 29 ++++++++++++++++++++--------- btrfs.c | 24 ++++++++++++------------ man/btrfs.8.in | 45 +++++++++++++++++++++++++-------------------- 3 files changed, 57 insertions(+), 41 deletions(-) all the block devices. .TP @@ -138,21 +143,21 @@ can expand the partition before enlarging the filesystem and shrink the partition after reducing the size of the filesystem. .TP -\fBfilesystem show\fR [<uuid>|<label>]\fR -Show the btrfs filesystem with some additional info. If no UUID or label is -passed, \fBbtrfs\fR show info of all the btrfs filesystem. +\fBfilesystem show\fR [<device>|<uuid>|<label>]\fR +Show the btrfs filesystem with some additional info. If no argument is +passed, \fBbtrfs\fR shows info of all the btrfs filesystems. .TP -\fBdevice balance\fR \fI<path>\fR +\fBfilesystem balance\fR \fI<path>\fR Balance the chunks of the filesystem identified by \fI<path>\fR across the devices. .TP -\fBdevice add\fR\fI <dev> [<dev>..] <path>\fR +\fBdevice add\fR\fI <device> [<device>...] <path>\fR Add device(s) to the filesystem identified by \fI<path>\fR. .TP -\fBdevice delete\fR\fI <dev> [<dev>..] <path>\fR +\fBdevice delete\fR\fI <device> [<device>...] <path>\fR Remove device(s) from a filesystem identified by \fI<path>\fR. .PP Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update for lzo supportLi Zefan2011-10-25
| | | | | | | | | | | | | | | | | | | [Btrfs-Progs][V2] Update for lzo support - Add incompat flag, otherwise btrfs-progs will report error when operating on btrfs filesystems mounted with lzo option. - Update man page. - Allow to turn on lzo compression for defrag operation: # btrfs filesystem defragment -c[zlib, lzo] <file> Note: "-c zlib" will fail, because that's how getopt() works for optional arguments. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: add support for mixed data+metadata block groupsJosef Bacik2011-10-25
| | | | | | | | | | | | So alot of crazy people (I'm looking at you Meego) want to use btrfs on phones and such with small devices. Unfortunately the way we split out metadata/data chunks it makes space usage inefficient for volumes that are smaller than 1gigabyte. So add a -M option for mixing metadata+data, and default to this mixed mode if the filesystem is less than or equal to 1 gigabyte. I've tested this with xfstests on a 100mb filesystem and everything is a-ok. Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: update super fields for space cacheJosef Bacik2011-10-25
| | | | | | | | | This patch updates the super field to add the cache_generation member. It also makes us set it to -1 on mkfs so any new filesystem will get the space cache stuff turned on. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Improve error handling in the btrfs commandGoffredo Baroncelli2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi Chris, below is enclosed a trivial patch, which has the aim to improve the error reporting of the "btrfs" command. You can pull from http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git branch strerror I changed every printf("some-error") to something like: e = errno; fprintf(stderr, "ERROR: .... - %s", strerror(e)); so: 1) all the error are reported to standard error 2) At the end of the message is printed the error as returned by the system. The change is quite simple, I replaced every printf("some-error") to the line above. I don't touched anything other. I also integrated a missing "printf" on the basis of the Ben patch. This patch leads the btrfs command to be more "user friendly" :-) Regards G.Baroncelli btrfs-list.c | 40 ++++++++++++++++++++++-------- btrfs_cmds.c | 77 ++++++++++++++++++++++++++++++++++++++++----------------- utils.c | 6 ++++ 3 files changed, 89 insertions(+), 34 deletions(-) Signed-off-by: Chris Mason <chris.mason@oracle.com>
* update man page to new defragment command interfaceHubert Kario2011-10-25
| | | | | | | | | | | | | | | | | | Update btrfs filesystem defragment command explanation. Add explanation of advanced parameters and notes about general usage. Add few notes about the btrfs <command> --help usage, fix related grammar. Signed-off-by: Hubert Kario <kario@wit.edu.pl> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs utils Informative errorsGoldwyn Rodrigues2011-10-25
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs use safe string manipulation functionsEduardo Silva2011-10-25
| | | | | Signed-off-by: Eduardo Silva <eduardo.silva@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: add a btrfs-select-super command to overwrite the superChris Mason2011-10-25
| | | | | | | | | | | | Btrfs stores multiple copies of the superblock, and for common power-failure crashes where barriers were not in use, one of the super copies is often valid while the first copy is not. This adds a btrfs-select-super -s N /dev/xxx command, which can overwrite all the super blocks with a copy that you have already determined is valid with btrfsck -s Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Check for RAID10 in set_avail_alloc_bitsChris Mason2011-04-22
| | | | | | | | | | | | | When raid is setup with mkfs, it is supposed to cow the initial filesystem it creates up to the desired raid level. RAID10 was not in the list of RAID levels it checked for, so the initial FS created for RAID10 actually only lived on the first disk. This works well enough because all the roots get quickly cowed during the first mount. The exception is the data relocation tree, which only gets cowed when we do a balance. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fill missing devices so degraded filesystems can be readChris Mason2011-04-22
| | | | | | | | When a device is missing, the btrfs tools need to be able to read alternate copies from the remaining devices. This creates placeholder devices that always return -EIO so the tools can limp along. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix the help text for btrfs-map-logicalChris Mason2011-04-22
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-debug-tree: add -d option to print only the device mappingChris Mason2010-10-06
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add rescue command to zero the logChris Mason2010-10-05
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfsck option to select the super block copyChris Mason2010-10-04
| | | | | | btrfsck -s 0 uses the defult 0, -s 1 uses copy #1 etc. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix undefined reference to symbol 'error_message'Yan Zheng2010-09-23
| | | | | | defination of error_message was moved into libcom_err.so Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Fix inode link count checks in btrfsckYan Zheng2010-09-23
| | | | Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Handle bad extent type caseFrederic Weisbecker2010-09-23
| | | | | | | | | | | | | | | | | | | If we meet a bad extent type, find_updated_files is going to print random things. Better warn the user about what happens. This fixes: btrfs-list.c: Dans la fonction «find_updated_files» : btrfs-list.c:668: attention : «disk_offset» may be used uninitialized in this function btrfs-list.c:668: note: «disk_offset» was declared here btrfs-list.c:667: attention : «disk_start» may be used uninitialized in this function btrfs-list.c:667: note: «disk_start» was declared here btrfs-list.c:666: attention : «len» may be used uninitialized in this function btrfs-list.c:666: note: «len» was declared here make: *** [btrfs-list.o] Erreur 1 Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
* Fix use after free in close_ctreeJeff Mahoney2010-09-23
| | | | | | | | | | | | | | | After the roots are closed, root is freed. Yet close_ctree continues to use it. It works generally because no new memory is allocated in the interim, but with glibc malloc perturbing enabled, it crashes every time. This is because root->fs_info points to garbage. This patch uses the already-cached fs_info variable for the rest of the accesses and fixes the crash. This issue was reported at: https://bugzilla.novell.com/show_bug.cgi?id=603620 Signed-off-by: Jeff Mahoney <jeffm@suse.com>
* Make csum_tree_block_size complain about the right thing.Zhu Yanhai2010-09-23
| | | | | | It dereferenced a wrong pointer before. Signed-off-by: Zhu Yanhai <yanhai.zhu@linux.intel.com>
* fix incompat flagsJosef Bacik2010-09-23
| | | | | | | | I forgot to add BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL to the incompat flags in btrfs-progs. This adds it so that our tools don't freak out when touching a fs with the default subvolume changed. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
* Avoid uninitialized variant compile warningZhao Lei2010-09-23
| | | | | | | | | | | | | | | | | | When we compile btrfs-progs in RHEL5(with default gcc version 4.1.2 20070626), we can get following error: cc1: warnings being treated as errors btrfs-list.c: In function 'find_updated_files': btrfs-list.c:668: warning: 'disk_offset' may be used uninitialized in this function btrfs-list.c:667: warning: 'disk_start' may be used uninitialized in this function btrfs-list.c:666: warning: 'len' may be used uninitialized in this function make: *** [btrfs-list.o] Error 1 These varient are always initialized except inconsistent data in file system. We can set initial value for these variant for this situation. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* fix a compile fail by strndup in RHEL5 envZhao Lei2010-09-23
| | | | | | | | | | | | | | | | | | | | | | When we compile btrfs-progs in RHEL5(with default gcc 4.1.2 and glibc-2.5-18), we can get following error: cc1: warnings being treated as errors btrfs-list.c: In function 'ino_resolve': btrfs-list.c:511: warning: implicit declaration of function 'strndup' btrfs-list.c:511: warning: incompatible implicit declaration of built-in function 'strndup' make: *** [btrfs-list.o] Error 1 ... cc1: warnings being treated as errors btrfs.c: In function 'split_command': btrfs.c:168: warning: implicit declaration of function 'strndup' btrfs.c:168: warning: incompatible implicit declaration of built-in function 'strndup' make: *** [btrfs-list.o] Error 1 We can add _GNU_SOURCE definition according man strndup. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* fix wrong return valueMiao Xie2010-09-23
| | | | | | | btrfsctl returns 1 if it does something successfully. this patch fixes this problem. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* Remove superfluous WARN_ON in btrfsckYan Zheng2010-09-23
| | | | Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* add mounted-checking for btrfs-volMiao Xie2010-09-23
| | | | | | | Adding a mounted device is dangerous because it will destroy the filesystem on that mounted device. So we add mounted-checking for btrfs-vol. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>