Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
"We have a small collection of fixes in my for-linus branch.

The big thing that stands out is a revert of a new ioctl. Users
haven't shipped yet in btrfs-progs, and Dave Sterba found a better way
to export the information"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: use right clone root offset for compressed extents
btrfs: fix null pointer deference at btrfs_sysfs_add_one+0x105
Btrfs: unset DCACHE_DISCONNECTED when mounting default subvol
Btrfs: fix max_inline mount option
Btrfs: fix a lockdep warning when cleaning up aborted transaction
Revert "btrfs: add ioctl to export size of global metadata reservation"

Changed files
+28 -23
fs
include
uapi
linux
-1
fs/btrfs/disk-io.c
··· 3839 3839 rb_erase(&ref->rb_node, &head->ref_root); 3840 3840 atomic_dec(&delayed_refs->num_entries); 3841 3841 btrfs_put_delayed_ref(ref); 3842 - cond_resched_lock(&head->lock); 3843 3842 } 3844 3843 if (head->must_insert_reserved) 3845 3844 pin_bytes = true;
+1 -1
fs/btrfs/inode.c
··· 5154 5154 return ERR_CAST(inode); 5155 5155 } 5156 5156 5157 - return d_splice_alias(inode, dentry); 5157 + return d_materialise_unique(dentry, inode); 5158 5158 } 5159 5159 5160 5160 unsigned char btrfs_filetype_table[] = {
-16
fs/btrfs/ioctl.c
··· 3537 3537 return ret; 3538 3538 } 3539 3539 3540 - static long btrfs_ioctl_global_rsv(struct btrfs_root *root, void __user *arg) 3541 - { 3542 - struct btrfs_block_rsv *block_rsv = &root->fs_info->global_block_rsv; 3543 - u64 reserved; 3544 - 3545 - spin_lock(&block_rsv->lock); 3546 - reserved = block_rsv->reserved; 3547 - spin_unlock(&block_rsv->lock); 3548 - 3549 - if (arg && copy_to_user(arg, &reserved, sizeof(reserved))) 3550 - return -EFAULT; 3551 - return 0; 3552 - } 3553 - 3554 3540 /* 3555 3541 * there are many ways the trans_start and trans_end ioctls can lead 3556 3542 * to deadlocks. They should only be used by applications that ··· 4743 4757 return btrfs_ioctl_logical_to_ino(root, argp); 4744 4758 case BTRFS_IOC_SPACE_INFO: 4745 4759 return btrfs_ioctl_space_info(root, argp); 4746 - case BTRFS_IOC_GLOBAL_RSV: 4747 - return btrfs_ioctl_global_rsv(root, argp); 4748 4760 case BTRFS_IOC_SYNC: { 4749 4761 int ret; 4750 4762
+10
fs/btrfs/send.c
··· 1332 1332 } 1333 1333 1334 1334 if (cur_clone_root) { 1335 + if (compressed != BTRFS_COMPRESS_NONE) { 1336 + /* 1337 + * Offsets given by iterate_extent_inodes() are relative 1338 + * to the start of the extent, we need to add logical 1339 + * offset from the file extent item. 1340 + * (See why at backref.c:check_extent_in_eb()) 1341 + */ 1342 + cur_clone_root->offset += btrfs_file_extent_offset(eb, 1343 + fi); 1344 + } 1335 1345 *found = cur_clone_root; 1336 1346 ret = 0; 1337 1347 } else {
+9 -2
fs/btrfs/super.c
··· 566 566 kfree(num); 567 567 568 568 if (info->max_inline) { 569 - info->max_inline = max_t(u64, 569 + info->max_inline = min_t(u64, 570 570 info->max_inline, 571 571 root->sectorsize); 572 572 } ··· 855 855 struct btrfs_path *path; 856 856 struct btrfs_key location; 857 857 struct inode *inode; 858 + struct dentry *dentry; 858 859 u64 dir_id; 859 860 int new = 0; 860 861 ··· 926 925 return dget(sb->s_root); 927 926 } 928 927 929 - return d_obtain_alias(inode); 928 + dentry = d_obtain_alias(inode); 929 + if (!IS_ERR(dentry)) { 930 + spin_lock(&dentry->d_lock); 931 + dentry->d_flags &= ~DCACHE_DISCONNECTED; 932 + spin_unlock(&dentry->d_lock); 933 + } 934 + return dentry; 930 935 } 931 936 932 937 static int btrfs_fill_super(struct super_block *sb,
+8 -2
fs/btrfs/sysfs.c
··· 578 578 return -ENOMEM; 579 579 580 580 list_for_each_entry(dev, &fs_devices->devices, dev_list) { 581 - struct hd_struct *disk = dev->bdev->bd_part; 582 - struct kobject *disk_kobj = &part_to_dev(disk)->kobj; 581 + struct hd_struct *disk; 582 + struct kobject *disk_kobj; 583 + 584 + if (!dev->bdev) 585 + continue; 586 + 587 + disk = dev->bdev->bd_part; 588 + disk_kobj = &part_to_dev(disk)->kobj; 583 589 584 590 error = sysfs_create_link(fs_info->device_dir_kobj, 585 591 disk_kobj, disk_kobj->name);
-1
include/uapi/linux/btrfs.h
··· 558 558 #define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64) 559 559 #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \ 560 560 struct btrfs_ioctl_space_args) 561 - #define BTRFS_IOC_GLOBAL_RSV _IOR(BTRFS_IOCTL_MAGIC, 20, __u64) 562 561 #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) 563 562 #define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) 564 563 #define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \