aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-16 12:32:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-16 12:32:33 -0500
commit4b48d9d44ebe0e8c31b4fe3b7480941576fff613 (patch)
tree457e0f1214ba44742f63e3cfc472ffbec206d0f3 /fs
parentb762666cc7c9f83ac5759127c29dfad438c09e48 (diff)
parentc071fcfdb60e7abbe95e02460005d6bca165bf24 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: fix ioctl arg size (userland incompatible change!) Btrfs: Clear the device->running_pending flag before bailing on congestion
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ioctl.h14
-rw-r--r--fs/btrfs/super.c3
-rw-r--r--fs/btrfs/volumes.c1
3 files changed, 11 insertions, 7 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h
index 78049ea208db..b320b103fa13 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -22,13 +22,20 @@
22 22
23#define BTRFS_IOCTL_MAGIC 0x94 23#define BTRFS_IOCTL_MAGIC 0x94
24#define BTRFS_VOL_NAME_MAX 255 24#define BTRFS_VOL_NAME_MAX 255
25#define BTRFS_PATH_NAME_MAX 3072 25#define BTRFS_PATH_NAME_MAX 4087
26 26
27/* this should be 4k */
27struct btrfs_ioctl_vol_args { 28struct btrfs_ioctl_vol_args {
28 __s64 fd; 29 __s64 fd;
29 char name[BTRFS_PATH_NAME_MAX + 1]; 30 char name[BTRFS_PATH_NAME_MAX + 1];
30}; 31};
31 32
33struct btrfs_ioctl_clone_range_args {
34 __s64 src_fd;
35 __u64 src_offset, src_length;
36 __u64 dest_offset;
37};
38
32#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ 39#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
33 struct btrfs_ioctl_vol_args) 40 struct btrfs_ioctl_vol_args)
34#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ 41#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -52,11 +59,6 @@ struct btrfs_ioctl_vol_args {
52 struct btrfs_ioctl_vol_args) 59 struct btrfs_ioctl_vol_args)
53#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \ 60#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \
54 struct btrfs_ioctl_vol_args) 61 struct btrfs_ioctl_vol_args)
55struct btrfs_ioctl_clone_range_args {
56 __s64 src_fd;
57 __u64 src_offset, src_length;
58 __u64 dest_offset;
59};
60 62
61#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \ 63#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \
62 struct btrfs_ioctl_clone_range_args) 64 struct btrfs_ioctl_clone_range_args)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 7256cf242eb0..db9fb3bc1e33 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -582,7 +582,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
582{ 582{
583 struct btrfs_ioctl_vol_args *vol; 583 struct btrfs_ioctl_vol_args *vol;
584 struct btrfs_fs_devices *fs_devices; 584 struct btrfs_fs_devices *fs_devices;
585 int ret = 0; 585 int ret = -ENOTTY;
586 int len; 586 int len;
587 587
588 if (!capable(CAP_SYS_ADMIN)) 588 if (!capable(CAP_SYS_ADMIN))
@@ -594,6 +594,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
594 goto out; 594 goto out;
595 } 595 }
596 len = strnlen(vol->name, BTRFS_PATH_NAME_MAX); 596 len = strnlen(vol->name, BTRFS_PATH_NAME_MAX);
597
597 switch (cmd) { 598 switch (cmd) {
598 case BTRFS_IOC_SCAN_DEV: 599 case BTRFS_IOC_SCAN_DEV:
599 ret = btrfs_scan_one_device(vol->name, FMODE_READ, 600 ret = btrfs_scan_one_device(vol->name, FMODE_READ,
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b187b537888e..3451e1cca2b5 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -220,6 +220,7 @@ loop:
220 tail->bi_next = old_head; 220 tail->bi_next = old_head;
221 else 221 else
222 device->pending_bio_tail = tail; 222 device->pending_bio_tail = tail;
223 device->running_pending = 0;
223 224
224 spin_unlock(&device->io_lock); 225 spin_unlock(&device->io_lock);
225 btrfs_requeue_work(&device->work); 226 btrfs_requeue_work(&device->work);