summaryrefslogtreecommitdiff
path: root/file-item.c
Commit message (Collapse)AuthorAge
* btrfs-progs: remove btrfs_release_path before btrfs_free_pathGui Hecheng2014-09-14
| | | | | | | The btrfs_free_path calls btrfs_release_path internally. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: deal with invalid key orderings and bad orphan items V2Josef Bacik2014-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A user had a fs where the objectid of an orphan item was not the actual orphan item objectid. This screwed up fsck because the block has keys in the wrong order, also the fs scanning stuff will freak out because we have an inode with nlink 0 and no orphan item. So this patch is pretty big but is all related. 1) Deal with bad key ordering. We can easily fix this up, so fix the checking stuff to tell us exactly what it found when it said there was a problem. Then if it's bad key ordering we can reorder the keys and restart the scan. 2) Deal with bad keys. If we find an orphan item with the wrong objectid it's likely to screw with stuff, so keep track of these sort of things with a bad_item list and just run through and delete any objects that don't make sense. So far we just do this for orphan items but we could extend this as new stuff pops up. 3) Deal with missing orphan items. This is easy, if we have a file with i_nlink set to 0 and no orphan item we can just add an orphan item. 4) Add the infrastructure to corrupt actual key values. Needed this to create a test image to verify I was fixing things properly. This patch fixes the corrupt image I'm adding and passes the other make test tests. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* btrfs-progs: mark static & remove unused from shared kernel codeEric Sandeen2013-09-03
| | | | | | | | | | | In files copied from the kernel, mark many functions as static, and remove any resulting dead code. Some functions are left unmarked if they aren't static in the kernel tree. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: drop unused parameter from btrfs_release_pathEric Sandeen2013-09-03
| | | | | | | | | | | | | | | Port of commit b3b4aa7 to userspace. parameter tree root it's not used since commit 5f39d397dfbe140a14edecd4e73c34ce23c4f9ee ("Btrfs: Create extent_buffer interface for large blocksizes") This gets userspace a tad closer to kernelspace by removing this unused parameter that was all over the codebase... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add missing path alloc return value checkFilipe David Borba Manana2013-08-09
| | | | | | | | | Also remove unused path in extent-tree.c:finish_current_insert(). Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Reviewed-by: 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: 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: 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>
* 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>
* Fix isize/nbytes update bugs in btrfs-convertYan Zheng2009-01-12
| | | | | | | These fix a few converter problems found by the new btrfsck code. Signed-off-by: Yan Zheng <zheng.yan@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-progs: support for different csum algorithimsJosef Bacik2008-12-02
| | | | | | | | | | | | | This is the btrfs-progs version of the patch to add the ability to have different csum algorithims. Note I didn't change the image maker since it seemed a bit more complicated than just changing some stuff around so I will let Yan take care of that. Everything else was converted and for now a mkfs just sets the type to be BTRFS_CSUM_TYPE_CRC32. Signed-off-by: Josef Bacik <jbacik@redhat.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>
* 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>
* Add some extra debugging around file data checksum failuresChris Mason2008-03-04
|
* Update btrfs-progs to match kernel sourcesYan2008-01-04
|
* Update btrfs-progs to better match the kernelYan2007-12-05
|
* add GPLv2Chris Mason2007-06-12
|
* Add inode map, and the start of file extent itemsChris Mason2007-03-20
|
* add inode itemChris Mason2007-03-15