summaryrefslogtreecommitdiff
path: root/cmds-rescue.c
Commit message (Collapse)AuthorAge
* btrfs-progs: cleanup, mark more functions staticDavid Sterba2015-09-14
| | | | | | Reported by sparse. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: cleanup, make usage strings staticDavid Sterba2015-09-14
| | | | | | Reported by sparse. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: unify naming of command handlersDavid Sterba2015-08-31
| | | | | | Use cmd_ + group + command schema. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add command group info stringsDavid Sterba2015-06-09
| | | | | | They're printed in the 'btrfs' command group summary. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add zero-log to rescue commandDavid Sterba2015-04-22
| | | | | | | | Copy the functionality of standalone btrfs-zero-log to the main tool. Delete man page for btrfs-zero-log and copy the relevant parts into btrfs-rescue(8). The standalone utility will be removed later. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: use check_argc_exact to check arg number of btrfs-rescueGui Hecheng2014-08-22
| | | | | | | The btrfs-rescue accepts exactly one arg for both chunk-recover & super-recover, use check_argc_exact clearly. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: judge the return value of check_mounted more accuratelyGui Hecheng2014-03-21
| | | | | | | | | | | | | | | For btrfs-convert, btrfstune, btrfs rescue, they report "device busy" when given a device that does not actually exist e.g. # btrfstune -x abcdefg (this device does not exist) $ ...device busy... We deal with this case by add "ret < 0" error check when judging the return value of check_mounted. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* Btrfs-progs: add super-recover to recover bad supersWang Shilong2013-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now if one of device's first superblock is corrupt,btrfs will fail to mount. Luckily, btrfs have at least two superblocks for every disk. In theory, if silent corrupting happens when we are writting superblocks into disk, we must hold at least one good superblock. One side effect is that user must gurantee that the disk must be a btrfs disk. Otherwise, this tool may destroy other fs.(This is also reason why btrfs only use first superblock in every disk to mount) This little program will try to correct bad superblocks from good superblocks with max generation. There will be five kinds of return values: 0: all supers are valid, no need to recover 1: usage or syntax error 2: recover all bad superblocks successfully 3: fail to recover bad superblocks 4: abort to recover bad superblocks Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: separate command and implementation of chunk-recover codeDavid Sterba2013-10-16
| | | | | | | | | | | | | The command has been moved and we should rename the files accordingly, so the entry point is now in cmds-rescue.c and the core functionality in it's own file. Return codes of btrfs_recover_chunk_tree have been simplified not to require a define and another file for defintion. CC: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: move chunk-recover to rescue groupDavid Sterba2013-10-16
| | | | | Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: introduce rescue command groupDavid Sterba2013-10-16
Add an empty 1st level command namespace that will collect specialized recovery tools like chunk-recover, zero-log, select-super and similar. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>