summaryrefslogtreecommitdiff
path: root/volumes.c
Commit message (Collapse)AuthorAge
* btrfs-progs: separate super_copy out of fs_infoDavid Sterba2013-03-10
| | | | | | | | | Allocate fs_info::super_copy dynamically of full BTRFS_SUPER_INFO_SIZE and use it directly for saving superblock to disk. This fixes incorrect superblock checksum after mkfs. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: check return of posix_fadviseEric Sandeen2013-03-10
| | | | | | | | It seems highly unlikely that posix_fadvise could fail, and even if it does, it was only advisory. Still, if it does, we could issue a notice to the user. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* btrfs-progs: avoid double-free in __btrfs_map_blockEric Sandeen2013-02-27
| | | | | | | | | | __btrfs_map_block() can possibly do the goto again: loop after having allocated & freed the "multi" pointer. There are then a couple error conditions where it will attempt to again kfree the now non-NULL multi pointer. So before retrying, reset multi to NULL after we free it. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* Merge branch 'cov-fixes-v1-integration-20130201' of ↵Chris Mason2013-02-06
|\ | | | | | | http://git.zabbo.net/cgit/btrfs-progs into merged
| * btrfs-progs: free path on read_chunk_tree errorZach Brown2013-02-05
| | | | | | | | | | | | | | Path allocation failure already has its own return, remember to free the path when the error label is taken. Signed-off-by: Zach Brown <zab@redhat.com>
| * btrfs-progs: don't write memory after sb to diskZach Brown2013-02-05
| | | | | | | | | | | | | | | | | | | | struct btrfs_super is about 3.5k but a few writing paths were writing it out as the full 4k BTRFS_SUPER_INFO_SIZE, leaking a few hundred bytes after the super_block onto disk. In practice this meant the memory after super_copy in struct btrfs_fs_info and whatever came after it in the heap. Signed-off-by: Zach Brown <zab@redhat.com>
* | Merge branch 'for-chris' of git://repo.or.cz/btrfs-progs-unstable/devel into ↵Chris Mason2013-02-06
|\| | | | | | | | | | | | | | | | | raid56 Conflicts: ctree.h Signed-off-by: Chris Mason <chris.mason@fusionio.com>
| * Btrfs-progs: add support for device replace procedureStefan Behrens2013-01-31
| | | | | | | | | | | | | | | | | | | | | | This is the user mode part of the device replace patch series. The command group "btrfs replace" is added with three commands: - btrfs replace start srcdev|srcdevid targetdev [-Bfr] mount_point - btrfs replace status mount_point [-1] - btrfs replace cancel mount_point Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* | Add basic RAID[56] supportDavid Woodhouse2013-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | David Woodhouse originally contributed this code, and Chris Mason changed it around to reflect the current design goals for raid56. The original code expected all metadata and data writes to be full stripes. This meant metadata block size == stripe size, and had a few other restrictions. This version allows metadata blocks smaller than the stripe size. It implements both raid5 and raid6, although it does not have code to rebuild from parity if one of the drives is missing or incorrect. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* | Clear caches when opening and closing devicesChris Mason2013-02-01
|/ | | | This should fix problems with cache aliases in the kernel
* Btrfs-progs: fix unaligned accessesArne Jansen2013-01-17
| | | | | | | | There are some unaligned accesses in progs that cause malfunction or crashes on ARM. This patch fixes the ones we stumbled upon. Signed-off-by: Arne Jansen <sensille@gmx.net>
* btrfsck: add early code to handle corrupted block groupsChris Mason2012-02-22
| | | | | | | This is mostly disabled, but it is step one in handling corrupted block groups in the extent allocation tree. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Scan /dev/md and device mapper devices lastChris Mason2012-02-22
| | | | | | | | | | | When we're using multipath or raid0, it is possible that btrfs dev scan will find one of the component devices instead of the proper virtual device the kernel creates. We want to make sure the kernel scans the virtual devices last, since it always remembers the last device it finds with a given fsid. 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: 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>
* remove unused variablesHubert Kario2011-10-25
| | | | | | | fixes compilation warnings with gcc 4.6.0 20110429 Signed-off-by: Hubert Kario <kario@wit.edu.pl> 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>
* 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>
* 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>
* Btrfs: update converter for the new disk formatYan Zheng2008-12-17
| | | | | | | | | | | This patch updates the ext3 to btrfs converter for the new disk format. This mainly involves changing the convert's data relocation and free space management code. This patch also ports some functions from kernel module to btrfs-progs. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Btrfs: Add inode sequence number for NFS and reserved space in a few structsChris Mason2008-12-08
| | | | | | | | | | | | | | | | | | | This adds a sequence number to the btrfs inode that is increased on every update. NFS will be able to use that to detect when an inode has changed, without relying on inaccurate time fields. While we're here, this also: Puts reserved space into the super block and inode Adds a log root transid to the super so we can pick the newest super based on the fsync log as well as the main transaction ID. For now the log root transid is always zero, but that'll get fixed. Adds a starting offset to the dev_item. This will let us do better alignment calculations if we know the start of a partition on the disk. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* superblock duplicationYan Zheng2008-12-05
| | | | | | | | | | This patch updates btrfs-progs for superblock duplication. Note: I didn't make this patch as complete as the one for kernel since updating the converter requires changing the code again. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Btrfs image toolYan Zheng2008-11-20
| | | | | | | | | This patch adds btrfs image tool. The image tool is a debugging tool that creates/restores btrfs metadump image. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* update btrfs-progs for seed device supportYan Zheng2008-11-18
| | | | | | | | | | | | This patch does the following: 1) Update device management code to match the kernel code. 2) Allocator fixes. 3) Add a program called btrfstune to set/clear the SEEDING super block flags.
* Fix compiler warning in volumes.cChris Mason2008-05-02
|
* Add mkfs.btrfs -A offset to control allocation start on devicesChris Mason2008-04-25
| | | | | | This is a utility option for the resizer, it makes sure to allocate at offset bytes in the disk or higher. It ensures the resizer will have something to move when testing it.
* Update the Ext3 converterChris Mason2008-04-22
| | | | | | | | | | | The main changes in this patch are adding chunk handing and data relocation ability. In the last step of conversion, the converter relocates data in system chunk and move chunk tree into system chunk. In the rollback process, the converter remove chunk tree from system chunk and copy data back. Regards YZ ---
* Add a command to show all of the btrfs filesystems on the box (btrfs-show)Chris Mason2008-04-22
|
* Fix chunk allocation when some devices don't have enough room for the stripeChris Mason2008-04-18
|
* Use better chunk sizes for small and large filesystemsChris Mason2008-04-18
|
* Add support for filesystem labels via mkfs.btrfs -LChris Mason2008-04-18
|
* Use device uuids when scanning devicesChris Mason2008-04-18
|
* Add raid10 supportChris Mason2008-04-16
|
* Add chunk uuids and update multi-device back referencesChris Mason2008-04-15
| | | | | | | | | | | | | | | | | | Block headers now store the chunk tree uuid Chunk items records the device uuid for each stripes Device extent items record better back refs to the chunk tree Block groups record better back refs to the chunk tree The chunk tree format has also changed. The objectid of BTRFS_CHUNK_ITEM_KEY used to be the logical offset of the chunk. Now it is a chunk tree id, with the logical offset being stored in the offset field of the key. This allows a single chunk tree to record multiple logical address spaces, upping the number of bytes indexed by a chunk tree from 2^64 to 2^128.
* Write all super blocks during commitChris Mason2008-04-10
|
* Retry metadata reads in the face of checksum failuresChris Mason2008-04-09
|
* Change btrfs_map_block to return a structure with mappings for all stripesChris Mason2008-04-09
|
* Recow all roots at the end of mkfsChris Mason2008-04-04
| | | | | | The mkfs code bootstraps the filesystem on a single device. Once the raid block groups are setup, it needs to recow all of the blocks so that each tree is properly allocated.
* Add support for single single duplication of metadataChris Mason2008-04-03
|
* Add mirroring support across multiple drivesChris Mason2008-04-03
|
* btrfs-progs: Fix printf format casting errorsAlex Chiang2008-04-01
| | | | | | | | | | | We get lots of warnings of the flavor: utils.c:441: warning: format '%Lu' expects type 'long long unsigned int' but argument 2 has type 'u64' And thanks to -Werror, the build fails. Clean up these printfs by properly casting the arg to the format specified. Signed-off-by: Alex Chiang <achiang@hp.com>
* Implement raid0 when multiple devices are presentChris Mason2008-03-25
| | | | This defaults to striping across all devices
* Walk all block devices looking for btrfsChris Mason2008-03-24
|
* ioctls to scan for btrfs filesystemsChris Mason2008-03-24
|
* Btrfsck updates for multi-device filesystemsChris Mason2008-03-24
|
* Dynamic chunk allocationChris Mason2008-03-24
|
* Add support for multiple devices per filesystemChris Mason2008-03-24