diff options
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 2e74e7d475ca..6751789fb379 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/file.h> | 25 | #include <linux/file.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/smp_lock.h> | ||
27 | #include <linux/compiler.h> | 28 | #include <linux/compiler.h> |
28 | #include <linux/err.h> | 29 | #include <linux/err.h> |
29 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
@@ -716,9 +717,11 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode, | |||
716 | dprintk(DBG_IOCTL, "%s: nbd_ioctl cmd=%s(0x%x) arg=%lu\n", | 717 | dprintk(DBG_IOCTL, "%s: nbd_ioctl cmd=%s(0x%x) arg=%lu\n", |
717 | lo->disk->disk_name, ioctl_cmd_to_ascii(cmd), cmd, arg); | 718 | lo->disk->disk_name, ioctl_cmd_to_ascii(cmd), cmd, arg); |
718 | 719 | ||
720 | lock_kernel(); | ||
719 | mutex_lock(&lo->tx_lock); | 721 | mutex_lock(&lo->tx_lock); |
720 | error = __nbd_ioctl(bdev, lo, cmd, arg); | 722 | error = __nbd_ioctl(bdev, lo, cmd, arg); |
721 | mutex_unlock(&lo->tx_lock); | 723 | mutex_unlock(&lo->tx_lock); |
724 | unlock_kernel(); | ||
722 | 725 | ||
723 | return error; | 726 | return error; |
724 | } | 727 | } |
@@ -726,7 +729,7 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode, | |||
726 | static const struct block_device_operations nbd_fops = | 729 | static const struct block_device_operations nbd_fops = |
727 | { | 730 | { |
728 | .owner = THIS_MODULE, | 731 | .owner = THIS_MODULE, |
729 | .locked_ioctl = nbd_ioctl, | 732 | .ioctl = nbd_ioctl, |
730 | }; | 733 | }; |
731 | 734 | ||
732 | /* | 735 | /* |