summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/block_dev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 5dde6dff4940..12b22ddb22ef 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -445,6 +445,12 @@ long bdev_direct_access(struct block_device *bdev, sector_t sector,
long avail;
const struct block_device_operations *ops = bdev->bd_disk->fops;
+ /*
+ * The device driver is allowed to sleep, in order to make the
+ * memory directly accessible.
+ */
+ might_sleep();
+
if (size < 0)
return size;
if (!ops->direct_access)