aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-01 21:01:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-01 21:01:41 -0400
commit1f2609460c4a96ef19c6bd2dadea46ad47e6dfa1 (patch)
tree1084e6380e8993f5db802e849d0bfae5bc5fbed5
parentf88cf230a43e08b3fb615e0520900a414f037440 (diff)
parent6d2b6170c8914c6c69256b687651fb16d7ec3e18 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro: "This contains a couple of fixes - one is the aio fix from Christoph, the other a fallocate() one from Eric" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: fix check for fallocate on active swapfile direct-io: fix AIO regression
-rw-r--r--fs/direct-io.c9
-rw-r--r--fs/open.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 194d0d122cae..17e39b047de5 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -71,7 +71,6 @@ struct dio_submit {
71 been performed at the start of a 71 been performed at the start of a
72 write */ 72 write */
73 int pages_in_io; /* approximate total IO pages */ 73 int pages_in_io; /* approximate total IO pages */
74 size_t size; /* total request size (doesn't change)*/
75 sector_t block_in_file; /* Current offset into the underlying 74 sector_t block_in_file; /* Current offset into the underlying
76 file in dio_block units. */ 75 file in dio_block units. */
77 unsigned blocks_available; /* At block_in_file. changes */ 76 unsigned blocks_available; /* At block_in_file. changes */
@@ -1104,7 +1103,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1104 unsigned blkbits = i_blkbits; 1103 unsigned blkbits = i_blkbits;
1105 unsigned blocksize_mask = (1 << blkbits) - 1; 1104 unsigned blocksize_mask = (1 << blkbits) - 1;
1106 ssize_t retval = -EINVAL; 1105 ssize_t retval = -EINVAL;
1107 loff_t end = offset + iov_iter_count(iter); 1106 size_t count = iov_iter_count(iter);
1107 loff_t end = offset + count;
1108 struct dio *dio; 1108 struct dio *dio;
1109 struct dio_submit sdio = { 0, }; 1109 struct dio_submit sdio = { 0, };
1110 struct buffer_head map_bh = { 0, }; 1110 struct buffer_head map_bh = { 0, };
@@ -1287,10 +1287,9 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1287 */ 1287 */
1288 BUG_ON(retval == -EIOCBQUEUED); 1288 BUG_ON(retval == -EIOCBQUEUED);
1289 if (dio->is_async && retval == 0 && dio->result && 1289 if (dio->is_async && retval == 0 && dio->result &&
1290 ((rw == READ) || (dio->result == sdio.size))) 1290 (rw == READ || dio->result == count))
1291 retval = -EIOCBQUEUED; 1291 retval = -EIOCBQUEUED;
1292 1292 else
1293 if (retval != -EIOCBQUEUED)
1294 dio_await_completion(dio); 1293 dio_await_completion(dio);
1295 1294
1296 if (drop_refcount(dio) == 0) { 1295 if (drop_refcount(dio) == 0) {
diff --git a/fs/open.c b/fs/open.c
index 36662d036237..d6fd3acde134 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -263,11 +263,10 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
263 return -EPERM; 263 return -EPERM;
264 264
265 /* 265 /*
266 * We can not allow to do any fallocate operation on an active 266 * We cannot allow any fallocate operation on an active swapfile
267 * swapfile
268 */ 267 */
269 if (IS_SWAPFILE(inode)) 268 if (IS_SWAPFILE(inode))
270 ret = -ETXTBSY; 269 return -ETXTBSY;
271 270
272 /* 271 /*
273 * Revalidate the write permissions, in case security policy has 272 * Revalidate the write permissions, in case security policy has