Commit 3962dfbe authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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"
parents 4302a875 93de4ba8
......@@ -3839,7 +3839,6 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
rb_erase(&ref->rb_node, &head->ref_root);
atomic_dec(&delayed_refs->num_entries);
btrfs_put_delayed_ref(ref);
cond_resched_lock(&head->lock);
}
if (head->must_insert_reserved)
pin_bytes = true;
......
......@@ -5154,7 +5154,7 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
return ERR_CAST(inode);
}
return d_splice_alias(inode, dentry);
return d_materialise_unique(dentry, inode);
}
unsigned char btrfs_filetype_table[] = {
......
......@@ -3537,20 +3537,6 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
return ret;
}
static long btrfs_ioctl_global_rsv(struct btrfs_root *root, void __user *arg)
{
struct btrfs_block_rsv *block_rsv = &root->fs_info->global_block_rsv;
u64 reserved;
spin_lock(&block_rsv->lock);
reserved = block_rsv->reserved;
spin_unlock(&block_rsv->lock);
if (arg && copy_to_user(arg, &reserved, sizeof(reserved)))
return -EFAULT;
return 0;
}
/*
* there are many ways the trans_start and trans_end ioctls can lead
* to deadlocks. They should only be used by applications that
......@@ -4757,8 +4743,6 @@ long btrfs_ioctl(struct file *file, unsigned int
return btrfs_ioctl_logical_to_ino(root, argp);
case BTRFS_IOC_SPACE_INFO:
return btrfs_ioctl_space_info(root, argp);
case BTRFS_IOC_GLOBAL_RSV:
return btrfs_ioctl_global_rsv(root, argp);
case BTRFS_IOC_SYNC: {
int ret;
......
......@@ -1332,6 +1332,16 @@ verbose_printk(KERN_DEBUG "btrfs: find_extent_clone: data_offset=%llu, "
}
if (cur_clone_root) {
if (compressed != BTRFS_COMPRESS_NONE) {
/*
* Offsets given by iterate_extent_inodes() are relative
* to the start of the extent, we need to add logical
* offset from the file extent item.
* (See why at backref.c:check_extent_in_eb())
*/
cur_clone_root->offset += btrfs_file_extent_offset(eb,
fi);
}
*found = cur_clone_root;
ret = 0;
} else {
......
......@@ -566,7 +566,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
kfree(num);
if (info->max_inline) {
info->max_inline = max_t(u64,
info->max_inline = min_t(u64,
info->max_inline,
root->sectorsize);
}
......@@ -855,6 +855,7 @@ static struct dentry *get_default_root(struct super_block *sb,
struct btrfs_path *path;
struct btrfs_key location;
struct inode *inode;
struct dentry *dentry;
u64 dir_id;
int new = 0;
......@@ -925,7 +926,13 @@ static struct dentry *get_default_root(struct super_block *sb,
return dget(sb->s_root);
}
return d_obtain_alias(inode);
dentry = d_obtain_alias(inode);
if (!IS_ERR(dentry)) {
spin_lock(&dentry->d_lock);
dentry->d_flags &= ~DCACHE_DISCONNECTED;
spin_unlock(&dentry->d_lock);
}
return dentry;
}
static int btrfs_fill_super(struct super_block *sb,
......
......@@ -578,8 +578,14 @@ static int add_device_membership(struct btrfs_fs_info *fs_info)
return -ENOMEM;
list_for_each_entry(dev, &fs_devices->devices, dev_list) {
struct hd_struct *disk = dev->bdev->bd_part;
struct kobject *disk_kobj = &part_to_dev(disk)->kobj;
struct hd_struct *disk;
struct kobject *disk_kobj;
if (!dev->bdev)
continue;
disk = dev->bdev->bd_part;
disk_kobj = &part_to_dev(disk)->kobj;
error = sysfs_create_link(fs_info->device_dir_kobj,
disk_kobj, disk_kobj->name);
......
......@@ -558,7 +558,6 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
struct btrfs_ioctl_space_args)
#define BTRFS_IOC_GLOBAL_RSV _IOR(BTRFS_IOCTL_MAGIC, 20, __u64)
#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment