summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfsck: add code to rebuild extent recordsChris Mason2012-02-07
| | | | | | | This also includes a new --repair btrfsck option. For now it can only fix errors in the extent allocation tree. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-corrupt-block: add -e option to corrupt the extent recordChris Mason2012-02-07
| | | | | | This will zero out the extent allocation tree records for the extent. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfsck: don't BUG on corrupted extent recordsChris Mason2012-02-06
|
* Allow extent_buffers to use more ramChris Mason2012-02-06
| | | | | | | | This changes free_some_buffers (called each time we allocate an extent buffer) to allow a higher hard limit on the number of extent buffers in use. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfsck: print some progressChris Mason2012-02-06
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add open_ctree_fs_info for partial FS opensChris Mason2012-02-05
| | | | | | | | | | fsck needs to be able to open a damaged FS, which means open_ctree needs to be able to return a damaged FS. This adds a new open_ctree_fs_info which can be used to open any and all roots that are valid. btrfs-debug-tree is changed to use it. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Merge branch 'restriper' of git://github.com/idryomov/btrfs-progsChris Mason2012-02-05
|\
| * Btrfs-progs: fall back to the v1 ioctl if the new balance ioctl failsChris Mason2012-02-05
| | | | | | | | | | | | | | | | This only falls back if the plain version of balance start is used. Any args make us report the ioctl isn't supported. Signed-off-by: Chris Mason <chris.mason@oracle.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* | Merge branch 'restriper' of git://github.com/idryomov/btrfs-progsChris Mason2012-02-05
|\|
| * Btrfs-progs: add restriper commandsIlya Dryomov2012-02-03
| | | | | | | | Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
| * Btrfs-progs: add 'balance' command group infrastructureIlya Dryomov2012-02-03
| | | | | | | | | | | | | | Add balance command group under both 'btrfs' and 'btrfs filesystem'. Preserve the old 'btrfs filesystem balance <path>' behaviour. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
| * Btrfs-progs: add restriper headersIlya Dryomov2012-02-03
| | | | | | | | | | | | Add restriper headers and update print-tree.c Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* | Merge branch 'parser' of git://github.com/idryomov/btrfs-progsChris Mason2012-02-05
|\|
| * Btrfs-progs: switch all existing commands to a new parserIlya Dryomov2012-02-03
| | | | | | | | | | | | | | The new infrastructure offloads checking number of arguments passed to a command to individual command handlers. Fix them up accordingly. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
| * Btrfs-progs: implement new subcommand parserIlya Dryomov2012-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completely replaces the existing subcommand infrastructure, which is not flexible enough to accomodate our needs. Instead of a global command table we now have per-level tables and command group handlers, which allows command-group-specific handling of options and subcommands. The new parser exports a clear interface and gets out of the way - all control over how matching is done is passed to commands and command group handlers. One side effect of this is that command implementors have to check the number of arguments themselves - patch to fix up all existing commands follows. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
| * Btrfs-progs: rearrange files in the repoIlya Dryomov2012-02-03
| | | | | | | | | | | | | | Separate every command group into its own file (cmds_<group>.c) and rearrange includes. Remove btrfs_cmds.c. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* | Btrfs-progs: change the way mkfs picks raid profilesIlya Dryomov2011-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently mkfs in response to mkfs.btrfs -d raid10 dev1 dev2 instead of telling "you can't do that" creates a SINGLE on two devices, and only rebalance can transform it to raid0. Generally, it never warns users about decisions it makes and it's not at all obvious which profile it picks when. Fix this by checking the number of effective devices and reporting back if the specified profile is impossible to create. Do not create FS in case invalid profile was given. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* | Btrfs-progs: fail gracefully on error from open_ctree()Ilya Dryomov2011-12-12
|/ | | | | | | Error checking block got moved mistakenly exposing us to a potential segmentation fault. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: Relocate -lpthread in makefileArnd Hannemann2011-12-01
| | | | | | | | | | | | | | | | | | | | | This patch fixes the following compile error when compiled with gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3): gcc -lpthread -g -O0 -o btrfs btrfs.o btrfs_cmds.o scrub.o \ ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o root-tree.o dir-item.o file-item.o inode-item.o inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o volumes.o utils.o btrfs-list.o btrfslabel.o -luuid scrub.o: In function `scrub_start': /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1342: undefined reference to `pthread_create' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1360: undefined reference to `pthread_create' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1374: undefined reference to `pthread_join' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1430: undefined reference to `pthread_cancel' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1432: undefined reference to `pthread_join' collect2: ld returned 1 exit status make: *** [btrfs] Error 1 The gcc man page says: "[...] the placement of the -l option is significant." so lets include -lpthread together with the usual $(LIBS) Signed-off-by: Arnd Hannemann <arnd@arndnet.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: make sure btrfs-zero-log writes somethingChris Mason2011-11-21
| | | | | | | The close_ctree code does a check to see if the FS has changed before it does any IO. This forces the commit. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add the tree history log to btrfs-progsChris Mason2011-11-05
| | | | | | This also adds btrfs-debug-tree -R to print the history Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: fix raid10 reading mathChris Mason2011-11-03
| | | | | | | | The btrfs-progs raid10 code has been silently reading the wrong raid10 block forever. We didn't notice because it was always fixed up by the retry code. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: added ioctls and commands to resolve inodes and logical addrsJan Schmidt2011-11-02
| | | | | | | | | two new commands that make use of the new path resolving functions implemented for scrub, doing the resolving in-kernel. the result for both commands is a list of files belonging to that inode / logical address. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: added resolve commands to man pageJan Schmidt2011-11-02
| | | | | | | Added "inspect-internal inode-resolve" and "inspect-internal logical-resolve" to the btrfs(8) man page. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
* Fix missing entries in listing of subvolumesLi Zefan2011-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stephane Chazelas <stephane.chazelas@gmail.com> writes: > I've got a btrfs FS with 84 subvolumes in it (some created with > "btrfs sub create", some with "btrfs sub snap" of the other > ones). There's no nesting of subvolumes at all (all direct children > of the root subvolume). > > The "btrfs subvolume list" is only showing 80 subvolumes. The 4 > missing ones (1 original volume, 3 snapshots) do exist on disk and > files in there have different st_devs from any other subvolume. > > I found > http://thread.gmane.org/gmane.comp.file-systems.btrfs/8123/focus=8208 > > which looks like the same issue, with Li Zefan saying he had a > fix, but I couldn't find any mention that it was actually fixed. Li Zefan <lizf@cn.fujitsu.com> replied: > After that, I posted a patch to fix btrfs-progs, which Chris aggreed > on: > > http://marc.info/?l=linux-btrfs&m=129238454714319&w=2 So this btrfs-progs patch should fix missing subvolumes in the output of "subvolume list": Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Btrfs-progs: btrfs-list: split list_subvolsChris Mason2011-11-02
| | | | | | | | | split list_subvols to separate functions and allow printing only in the containing function. lets us make use of those functions when resolving logical addresses. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Merge branch 'recovery-beta' of ↵Chris Mason2011-10-31
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs
| * btrfs-progs: remove old debugging statementChris Mason2011-10-27
| | | | | | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
| * btrfs-progs: add a utility to corrupt a single blockChris Mason2011-10-27
| |
| * btrfs-debug-tree: add -r option to print only the rootsChris Mason2011-10-27
| | | | | | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
| * restore: deal with holes and set i_size correctlyChris Mason2011-10-27
| | | | | | | | | | | | | | | | This changes restore to set the i_size of the files it copies out based on the size in the inode. It also changes it to skip over holes. Signed-off-by: Chris Mason <chris.mason@oracle.com>
| * btrfs-progs: fixup is_mounted checksChris Mason2011-10-27
| | | | | | | | | | | | | | | | | | | | /proc/mounts contains device names that don't exist, we end up erroring out because we're not able to stat the device (that doesn't exist). Fix this by allowing the mkfs when the target device doesn't exist. Signed-off-by: Chris Mason <chris.mason@oracle.com>
| * btrfs-progs: add a recovery utility to pull files from damanged filesystemsJosef Bacik2011-10-27
| | | | | | | | | | Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
| * Print the root generation in btrfs-debug-treeChris Mason2011-10-27
| | | | | | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* | Print the root generation in btrfs-debug-treeChris Mason2011-10-25
|/ | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: make btrfs df report profiles for mixed block groupsIlya Dryomov2011-10-25
| | | | | | | | Profiles other than SINGLE for mixed chunks might sound a bit strange, but there is nothing in the filesystem that prevents a crazy user from doing it. So make "btrfs fi df" report them properly. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* btrfs-progs: Improvement for making btrfs image from source directory.Zhong, Xin2011-10-25
| | | | | | | | | | | | * Initialize ret in btrfs_csum_file_block * Do not abort when xattr is not supported in the source directory * Remove size limitation of 256M * Alloc data chunk in a smaller size (8M) to make btrfs image smaller * Let user specify the btrfs image name Depends on below patch from samsung guys: http://marc.info/?l=linux-btrfs&m=127858068226025&w=2 Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
* Scan the devices listed in /proc/partitionsGoffredo Baroncelli2011-10-25
| | | | | | | | | | | During the commands: - btrfs filesystem show - btrfs device scan the devices "scanned" are extracted from /proc/partitions. This should avoid to scan devices not suitable for a btrfs filesystem like cdrom and floppy or to scan not existant devices. The old behavior (scan all the block devices under /dev) may be forced passing the "--all-devices" switch.
* Btrfs-progs: specify label length larger than 255 bytes cause mkfs.btrfs ↵Jeff Liu2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buffer overflow Hello, While going through the mkfs.c, I noticed there is an issue for label length checking, mkfs.btrfs will crashed if the label length exceeding 255 bytes, it's easy to triggered that out as below: jeff@pibroch:~/opensource/btrfs-progs$ sudo ./mkfs.btrfs -L `perl -e 'print "A"x256'` /usr/src/linux-3.0/img0 WARNING! - Btrfs v0.19-35-g1b444cd IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using *** buffer overflow detected ***: ./mkfs.btrfs terminated ======= Backtrace: ========= /lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0xb7774df0] /lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0xb7773cca] /lib/i386-linux-gnu/libc.so.6(__strcpy_chk+0x3f)[0xb777305f] ./mkfs.btrfs[0x805acc4] ./mkfs.btrfs[0x805def6] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0xb76a5e37] ./mkfs.btrfs[0x8048ef1] ======= Memory map: ======== ...... a tiny patch could fix it. Signed-off-by: Jie Liu <jeff.liu@oracle.com>
* btrfsck: decode error properlySergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | check_mounted() returns kernel-style negative errors. Patch drops sign for strerror(). Before the patch: check_mounted(): Could not open /dev/sdb2 Could not check mount status: Unknown error 18446744073709551603 After the patch: check_mounted(): Could not open /dev/sdb2 Could not check mount status: Permission denied Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* check number of args for btrfs sub snap correctlyAndreas Philipp2011-10-25
| | | | | | | | Check whether there are the right number of arguments (exatly 2 without the flag -r) in the subcommand handler for the btrfs subvolume snapshot command. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
* Btrfs-progs: add "btrfs subvolume get-default" subcommandZhong, Xin2011-10-25
| | | | | | | | | | | | | | Add subcommand to get the default subvolume of btrfs filesystem V2->V3: * add man page * based on http://git.darksatanic.net/repo/btrfs-progs-unstable.git integration-20110705 Reviewed-by: Andreas Philipp <philipp.andreas@gmail.com> Reviewed-by: Goffredo Baroncelli <kreijack@libero.it> Reported-by: Yang, Yi <yi.y.yang@intel.com> Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
* btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALLWang Sheng-Hui2011-10-25
| | | | | | | | | | | | | From c04da1655df6d75db834ddbd3a3b4a58a0d9a0c9 Mon Sep 17 00:00:00 2001 From: Wang Sheng-Hui <shhuiw@gmail.com> Date: Mon, 18 Jul 2011 02:17:31 -0500 Subject: [PATCH] btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL debug-tree doesn't exist after btrfs-progs installed. Use btrfs-debug-tree to print FS metadata in text form, not debug-tree. Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
* fix incorrect argument checking for "btrfs sub snap -r"Hugo Mills2011-10-25
| | | | | | | | Stephane Chazelas and Andreas Philipp spotted that the earlier patch fixing this issue was incomplete, and should also update the argument- count checking code as well. Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: scrub added to manpageJan Schmidt2011-10-25
| | | | | Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: scrub userland implementationJan Schmidt2011-10-25
| | | | | Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: added check_mounted_whereJan Schmidt2011-10-25
| | | | | | | | | new version of check_mounted() returning more information gathered while searching. check_mounted() is now a wrapper for check_mounted_where(). the new version is needed by scrub.c Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: scrub ioctlsJan Schmidt2011-10-25
| | | | | | | | | - scrub structs added - ioctls for scrub - BTRFS_FSID_SIZE moved Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: commands addedJan Schmidt2011-10-25
| | | | | | | | - scrub commands added - open_file_or_dir no longer static (needed by scrub.c) Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* remove unused include "version.h"Andreas Philipp2011-10-25
| | | | | | | | In the file btrfs-list.c version.h was included but not used. So just drop it. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>