summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-15 04:21:53 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-15 04:21:53 +0300
commitcf1b3341afab9d3ad02a76b3a619ea027dcf4e28 (patch)
tree99d5e2df998556c6ba1e9022eaa361aee74bf4a8 /fs
parent80eabba70260dcb55b05098f6c1fecbe5c0e518b (diff)
parentd1b1cea1e58477dad88ff769f54c0d2dfa56d923 (diff)
downloadlinux-cf1b3341afab9d3ad02a76b3a619ea027dcf4e28.tar.xz
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block IO fixes from Jens Axboe: "A few fixes that I collected as post-merge. I was going to wait a bit with sending this out, but the O_DIRECT fix should really go in sooner rather than later" * 'for-linus' of git://git.kernel.dk/linux-block: blk-mq: Fix failed allocation path when mapping queues blk-mq: Avoid memory reclaim when remapping queues block_dev: don't update file access position for sync direct IO nvme/pci: Log PCI_STATUS when the controller dies block_dev: don't test bdev->bd_contains when it is not stable
Diffstat (limited to 'fs')
-rw-r--r--fs/block_dev.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 95acbd2ebc5d..7c4507224ed6 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -264,7 +264,6 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
if (unlikely(bio.bi_error))
return bio.bi_error;
- iocb->ki_pos += ret;
return ret;
}
@@ -411,10 +410,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
__set_current_state(TASK_RUNNING);
ret = dio->bio.bi_error;
- if (likely(!ret)) {
+ if (likely(!ret))
ret = dio->size;
- iocb->ki_pos += ret;
- }
bio_put(&dio->bio);
return ret;
@@ -1089,7 +1086,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,
return true; /* already a holder */
else if (bdev->bd_holder != NULL)
return false; /* held by someone else */
- else if (bdev->bd_contains == bdev)
+ else if (whole == bdev)
return true; /* is a whole device which isn't held */
else if (whole->bd_holder == bd_may_claim)