Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-5.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
"Two races fixed, memory leak fix, sysfs directory fixup and two new
log messages:

- two fixed race conditions: extent map merging and truncate vs
fiemap

- create the right sysfs directory with device information and move
the individual device dirs under it

- print messages when the tree-log is replayed at mount time or
cannot be replayed on remount"

* tag 'for-5.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: sysfs, move device id directories to UUID/devinfo
btrfs: sysfs, add UUID/devinfo kobject
Btrfs: fix race between shrinking truncate and fiemap
btrfs: log message when rw remount is attempted with unclean tree-log
btrfs: print message when tree-log replay starts
Btrfs: fix race between using extent maps and merging them
btrfs: ref-verify: fix memory leaks

+44 -1
+1
fs/btrfs/disk-io.c
··· 3164 3164 /* do not make disk changes in broken FS or nologreplay is given */ 3165 3165 if (btrfs_super_log_root(disk_super) != 0 && 3166 3166 !btrfs_test_opt(fs_info, NOLOGREPLAY)) { 3167 + btrfs_info(fs_info, "start tree-log replay"); 3167 3168 ret = btrfs_replay_log(fs_info, fs_devices); 3168 3169 if (ret) { 3169 3170 err = ret;
+11
fs/btrfs/extent_map.c
··· 237 237 struct extent_map *merge = NULL; 238 238 struct rb_node *rb; 239 239 240 + /* 241 + * We can't modify an extent map that is in the tree and that is being 242 + * used by another task, as it can cause that other task to see it in 243 + * inconsistent state during the merging. We always have 1 reference for 244 + * the tree and 1 for this task (which is unpinning the extent map or 245 + * clearing the logging flag), so anything > 2 means it's being used by 246 + * other tasks too. 247 + */ 248 + if (refcount_read(&em->refs) > 2) 249 + return; 250 + 240 251 if (em->start != 0) { 241 252 rb = rb_prev(&em->rb_node); 242 253 if (rb)
+8
fs/btrfs/inode.c
··· 4085 4085 u64 bytes_deleted = 0; 4086 4086 bool be_nice = false; 4087 4087 bool should_throttle = false; 4088 + const u64 lock_start = ALIGN_DOWN(new_size, fs_info->sectorsize); 4089 + struct extent_state *cached_state = NULL; 4088 4090 4089 4091 BUG_ON(new_size > 0 && min_type != BTRFS_EXTENT_DATA_KEY); 4090 4092 ··· 4102 4100 if (!path) 4103 4101 return -ENOMEM; 4104 4102 path->reada = READA_BACK; 4103 + 4104 + lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, (u64)-1, 4105 + &cached_state); 4105 4106 4106 4107 /* 4107 4108 * We want to drop from the next block forward in case this new size is ··· 4371 4366 last_size = new_size; 4372 4367 btrfs_ordered_update_i_size(inode, last_size, NULL); 4373 4368 } 4369 + 4370 + unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, (u64)-1, 4371 + &cached_state); 4374 4372 4375 4373 btrfs_free_path(path); 4376 4374 return ret;
+5
fs/btrfs/ref-verify.c
··· 744 744 */ 745 745 be = add_block_entry(fs_info, bytenr, num_bytes, ref_root); 746 746 if (IS_ERR(be)) { 747 + kfree(ref); 747 748 kfree(ra); 748 749 ret = PTR_ERR(be); 749 750 goto out; ··· 758 757 "re-allocated a block that still has references to it!"); 759 758 dump_block_entry(fs_info, be); 760 759 dump_ref_action(fs_info, ra); 760 + kfree(ref); 761 + kfree(ra); 761 762 goto out_unlock; 762 763 } 763 764 ··· 822 819 "dropping a ref for a existing root that doesn't have a ref on the block"); 823 820 dump_block_entry(fs_info, be); 824 821 dump_ref_action(fs_info, ra); 822 + kfree(ref); 825 823 kfree(ra); 826 824 goto out_unlock; 827 825 } ··· 838 834 "attempting to add another ref for an existing ref on a tree block"); 839 835 dump_block_entry(fs_info, be); 840 836 dump_ref_action(fs_info, ra); 837 + kfree(ref); 841 838 kfree(ra); 842 839 goto out_unlock; 843 840 }
+2
fs/btrfs/super.c
··· 1834 1834 } 1835 1835 1836 1836 if (btrfs_super_log_root(fs_info->super_copy) != 0) { 1837 + btrfs_warn(fs_info, 1838 + "mount required to replay tree-log, cannot remount read-write"); 1837 1839 ret = -EINVAL; 1838 1840 goto restore; 1839 1841 }
+16 -1
fs/btrfs/sysfs.c
··· 901 901 902 902 static void __btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs) 903 903 { 904 + if (fs_devs->devinfo_kobj) { 905 + kobject_del(fs_devs->devinfo_kobj); 906 + kobject_put(fs_devs->devinfo_kobj); 907 + fs_devs->devinfo_kobj = NULL; 908 + } 909 + 904 910 if (fs_devs->devices_kobj) { 905 911 kobject_del(fs_devs->devices_kobj); 906 912 kobject_put(fs_devs->devices_kobj); ··· 1295 1289 1296 1290 init_completion(&dev->kobj_unregister); 1297 1291 error = kobject_init_and_add(&dev->devid_kobj, &devid_ktype, 1298 - fs_devices->devices_kobj, "%llu", 1292 + fs_devices->devinfo_kobj, "%llu", 1299 1293 dev->devid); 1300 1294 if (error) { 1301 1295 kobject_put(&dev->devid_kobj); ··· 1372 1366 btrfs_err(fs_devs->fs_info, 1373 1367 "failed to init sysfs device interface"); 1374 1368 kobject_put(&fs_devs->fsid_kobj); 1369 + return -ENOMEM; 1370 + } 1371 + 1372 + fs_devs->devinfo_kobj = kobject_create_and_add("devinfo", 1373 + &fs_devs->fsid_kobj); 1374 + if (!fs_devs->devinfo_kobj) { 1375 + btrfs_err(fs_devs->fs_info, 1376 + "failed to init sysfs devinfo kobject"); 1377 + btrfs_sysfs_remove_fsid(fs_devs); 1375 1378 return -ENOMEM; 1376 1379 } 1377 1380
+1
fs/btrfs/volumes.h
··· 258 258 /* sysfs kobjects */ 259 259 struct kobject fsid_kobj; 260 260 struct kobject *devices_kobj; 261 + struct kobject *devinfo_kobj; 261 262 struct completion kobj_unregister; 262 263 }; 263 264