summaryrefslogtreecommitdiff
path: root/convert/source-ext2.c
Commit message (Collapse)AuthorAge
* btrfs-progs: convert/ext2: Fix memory leak caused by handled ext2_filsysQu Wenruo2018-02-14
| | | | | | | | | | | | | Exposed by convert-test with D=asan. Unlike btrfs, ext2fs_close() still leaves its ext2_filsys parameter filled with allocated pointers. It needs ext2fs_free() to free those pointers. Issue: #92 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Sync code with kernel for BTRFS_MAX_INLINE_DATA_SIZEGu Jinxiang2018-02-02
| | | | | | | | | | | | | Do a cleanup. Also make it consistent with kernel. Use fs_info instead of root for BTRFS_MAX_INLINE_DATA_SIZE, since maybe in some situation we do not know root, but just know fs_info. Change macro to inline function to be consistent with kernel. And change the function body to match kernel. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Use fs_info instead of root for BTRFS_LEAF_DATA_SIZEGu Jinxiang2018-02-02
| | | | | | | | | | Do a cleanup. Also make it consistent with kernel. Use fs_info instead of root for BTRFS_LEAF_DATA_SIZE, since maybe in some situation we do not know root, but just know fs_info. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use correct string printing for errcode_tDavid Sterba2017-09-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: don't print message when fs is not recognized, ext2David Sterba2017-09-08
| | | | | | | Bad magic error means it's not the desired filesystem so the error message is just noise. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add crude error handling when transaction start failsDavid Sterba2017-09-08
| | | | | | | | | | Currently transaction bugs out insided btrfs_start_transaction in case of error, we want to lift the error handling to the callers. This patch adds the BUG_ON anywhere it's been missing so far. This is not the best way of course. Transforming BUG_ON to a proper error handling highly depends on the caller and should be dealt with case by case. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move and rename dev_t helpers to common fileDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move acl helper to common source fileDavid Sterba2017-09-08
| | | | | | There were 2 copies of ext2_acl_count and acl_ea_size. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Fix data race when reporting progressAdam Buchbinder2017-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The status display was reading the state while the task was updating it. Use a mutex to prevent the race. This race was detected using ThreadSanitizer and misc-tests/005-convert-progress-thread-crash. ================== WARNING: ThreadSanitizer: data race Write of size 8 by main thread: #0 ext2_copy_inodes btrfs-progs/convert/source-ext2.c:853 #1 copy_inodes btrfs-progs/convert/main.c:145 #2 do_convert btrfs-progs/convert/main.c:1297 #3 main btrfs-progs/convert/main.c:1924 Previous read of size 8 by thread T1: #0 print_copied_inodes btrfs-progs/convert/main.c:124 Location is stack of main thread. Thread T1 (running) created by main thread at: #0 pthread_create <null> #1 task_start btrfs-progs/task-utils.c:50 #2 do_convert btrfs-progs/convert/main.c:1295 #3 main btrfs-progs/convert/main.c:1924 SUMMARY: ThreadSanitizer: data race btrfs-progs/convert/source-ext2.c:853 in ext2_copy_inodes Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Refactor sectorsize users in convert/source-ext2.cQu Wenruo2017-07-03
| | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* Btrfs-progs: convert: do not clear nodatasum flag in inode itemLiu Bo2017-06-30
| | | | | | | | | With the current btrfs-convert, if we convert a ext4 without data checksum, it'd not set nodatasum flag in inode item, nor create csum item, reading file ends up with checksum errors. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Add larger device supportLakshmipathi.G2017-06-26
| | | | | | | | | | | | | | | | With larger file system (in this case its 22TB), ext2fs_open() returns EXT2_ET_CANT_USE_LEGACY_BITMAPS error message with ext2fs_read_block_bitmap(). To overcome this issue, (a) we need pass EXT2_FLAG_64BITS flag with ext2fs_open. (b) use 64-bit functions like ext2fs_get_block_bitmap_range2, ext2fs_inode_data_blocks2,ext2fs_read_ext_attr2 (c) use 64bit types with btrfs_convert_context fields Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=194795 Signed-off-by: Lakshmipathi.G <lakshmipathi.g@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add missing limits headersBaruch Siach2017-03-16
| | | | | | | Build under musl libc fails because of missing PATH_MAX and XATTR_NAME_MAX macro declarations. Add the required headers. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
* btrfs-progs: convert: rename members that clash with other functionsDavid Sterba2017-03-08
| | | | | | Rename 'free' and also 'used' for consistency. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: rename ext2 function to create a symlinkDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use bit field for convert flagsDavid Sterba2017-03-08
| | | | | | | Use one flag field instead of several variables. The change cascades down to the callchain and modifies several functions. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use helper for special inode number checkDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: better error handling in ext2_read_used_spaceDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move ext2 conversion out of main.cDavid Sterba2017-03-08
Signed-off-by: David Sterba <dsterba@suse.com>