History

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"

Linus Torvalds committed 12 years ago

Commit 3962dfb2 parents 4302a87 93de4ba7 files · +28 −23Browse files

Unified · Split

7 files
  1. fs/btrfs/disk-io.c +0 −1
  2. fs/btrfs/inode.c +1 −1
  3. fs/btrfs/ioctl.c +0 −16
  4. fs/btrfs/send.c +10 −0
  5. fs/btrfs/super.c +9 −2
  6. fs/btrfs/sysfs.c +8 −2
  7. include/uapi/linux/btrfs.h +0 −1
fs/btrfs/disk-io.c+0−1
@@ -3839,7 +3839,6 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, · 3838 unmodified lines
3839 rb_erase(&ref->rb_node, &head->ref_root);3839 rb_erase(&ref->rb_node, &head->ref_root);
3840 atomic_dec(&delayed_refs->num_entries);3840 atomic_dec(&delayed_refs->num_entries);
3841 btrfs_put_delayed_ref(ref);3841 btrfs_put_delayed_ref(ref);
3842 cond_resched_lock(&head->lock);
3843 }3842 }
3844 if (head->must_insert_reserved)3843 if (head->must_insert_reserved)
3845 pin_bytes = true;3844 pin_bytes = true;
fs/btrfs/inode.c+1−1
@@ -5154,7 +5154,7 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, · 5153 unmodified lines
5154 return ERR_CAST(inode);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
5160unsigned char btrfs_filetype_table[] = {5160unsigned char btrfs_filetype_table[] = {
fs/btrfs/ioctl.c+0−16
@@ -3537,20 +3537,6 @@ out: · 3536 unmodified lines
3537 return ret;3537 return ret;
3538}3538}
3539 3539
3540static 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 * there are many ways the trans_start and trans_end ioctls can lead3541 * there are many ways the trans_start and trans_end ioctls can lead
3556 * to deadlocks. They should only be used by applications that3542 * to deadlocks. They should only be used by applications that
@@ -4757,8 +4743,6 @@ long btrfs_ioctl(struct file *file, unsigned int · 1200 unmodified lines
4757 return btrfs_ioctl_logical_to_ino(root, argp);4743 return btrfs_ioctl_logical_to_ino(root, argp);
4758 case BTRFS_IOC_SPACE_INFO:4744 case BTRFS_IOC_SPACE_INFO:
4759 return btrfs_ioctl_space_info(root, argp);4745 return btrfs_ioctl_space_info(root, argp);
4760 case BTRFS_IOC_GLOBAL_RSV:
4761 return btrfs_ioctl_global_rsv(root, argp);
4762 case BTRFS_IOC_SYNC: {4746 case BTRFS_IOC_SYNC: {
4763 int ret;4747 int ret;
4764 4748
fs/btrfs/send.c+10−0
@@ -1332,6 +1332,16 @@ verbose_printk(KERN_DEBUG "btrfs: find_extent_clone: data_offset=%llu, " · 1331 unmodified lines
1332 }1332 }
1333 1333
1334 if (cur_clone_root) {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 *found = cur_clone_root;1345 *found = cur_clone_root;
1336 ret = 0;1346 ret = 0;
1337 } else {1347 } else {
fs/btrfs/super.c+9−2
@@ -566,7 +566,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) · 565 unmodified lines
566 kfree(num);566 kfree(num);
567 567
568 if (info->max_inline) {568 if (info->max_inline) {
569 info->max_inline = max_t(u64,569 info->max_inline = min_t(u64,
570 info->max_inline,570 info->max_inline,
571 root->sectorsize);571 root->sectorsize);
572 }572 }
@@ -855,6 +855,7 @@ static struct dentry *get_default_root(struct super_block *sb, · 282 unmodified lines
855 struct btrfs_path *path;855 struct btrfs_path *path;
856 struct btrfs_key location;856 struct btrfs_key location;
857 struct inode *inode;857 struct inode *inode;
858 struct dentry *dentry;
858 u64 dir_id;859 u64 dir_id;
859 int new = 0;860 int new = 0;
860 861
@@ -925,7 +926,13 @@ setup_root: · 64 unmodified lines
925 return dget(sb->s_root);926 return dget(sb->s_root);
926 }927 }
927 928
928 return d_obtain_alias(inode);929 dentry = d_obtain_alias(inode);
930 if (!IS_ERR(dentry)) {
931 spin_lock(&dentry->d_lock);
932 dentry->d_flags &= ~DCACHE_DISCONNECTED;
933 spin_unlock(&dentry->d_lock);
934 }
935 return dentry;
929}936}
930 937
931static int btrfs_fill_super(struct super_block *sb,938static int btrfs_fill_super(struct super_block *sb,
fs/btrfs/sysfs.c+8−2
@@ -578,8 +578,14 @@ static int add_device_membership(struct btrfs_fs_info *fs_info) · 577 unmodified lines
578 return -ENOMEM;578 return -ENOMEM;
579 579
580 list_for_each_entry(dev, &fs_devices->devices, dev_list) {580 list_for_each_entry(dev, &fs_devices->devices, dev_list) {
581 struct hd_struct *disk = dev->bdev->bd_part;581 struct hd_struct *disk;
582 struct kobject *disk_kobj = &part_to_dev(disk)->kobj;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 error = sysfs_create_link(fs_info->device_dir_kobj,590 error = sysfs_create_link(fs_info->device_dir_kobj,
585 disk_kobj, disk_kobj->name);591 disk_kobj, disk_kobj->name);
include/uapi/linux/btrfs.h+0−1
@@ -558,7 +558,6 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code) · 557 unmodified lines
558#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)558#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
559#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \559#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
560 struct btrfs_ioctl_space_args)560 struct btrfs_ioctl_space_args)
561#define BTRFS_IOC_GLOBAL_RSV _IOR(BTRFS_IOCTL_MAGIC, 20, __u64)
562#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)561#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
563#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)562#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
564#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \563#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t