diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-01-12 05:01:12 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-01-12 05:01:12 -0500 |
commit | 1f16f116b01c110db20ab808562c8b8bc3ee3d6e (patch) | |
tree | 44db563f64cf5f8d62af8f99a61e2b248c44ea3a /fs/direct-io.c | |
parent | 03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2 (diff) | |
parent | f9eccf24615672896dc13251410c3f2f33a14f95 (diff) |
Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull in fixes from Daniel Lezcano:
- Fix the vt8500 timer leading to a system lock up when dealing with too
small delta (Roman Volkov)
- Select the CLKSRC_MMIO when the fsl_ftm_timer is enabled with COMPILE_TEST
(Daniel Lezcano)
- Prevent to compile timers using the 'iomem' API when the architecture has
not HAS_IOMEM set (Richard Weinberger)
Diffstat (limited to 'fs/direct-io.c')
-rw-r--r-- | fs/direct-io.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index cb5337d8c273..602e8441bc0f 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -1169,6 +1169,16 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, | |||
1169 | } | 1169 | } |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | /* Once we sampled i_size check for reads beyond EOF */ | ||
1173 | dio->i_size = i_size_read(inode); | ||
1174 | if (iov_iter_rw(iter) == READ && offset >= dio->i_size) { | ||
1175 | if (dio->flags & DIO_LOCKING) | ||
1176 | mutex_unlock(&inode->i_mutex); | ||
1177 | kmem_cache_free(dio_cache, dio); | ||
1178 | retval = 0; | ||
1179 | goto out; | ||
1180 | } | ||
1181 | |||
1172 | /* | 1182 | /* |
1173 | * For file extending writes updating i_size before data writeouts | 1183 | * For file extending writes updating i_size before data writeouts |
1174 | * complete can expose uninitialized blocks in dumb filesystems. | 1184 | * complete can expose uninitialized blocks in dumb filesystems. |
@@ -1222,7 +1232,6 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, | |||
1222 | sdio.next_block_for_io = -1; | 1232 | sdio.next_block_for_io = -1; |
1223 | 1233 | ||
1224 | dio->iocb = iocb; | 1234 | dio->iocb = iocb; |
1225 | dio->i_size = i_size_read(inode); | ||
1226 | 1235 | ||
1227 | spin_lock_init(&dio->bio_lock); | 1236 | spin_lock_init(&dio->bio_lock); |
1228 | dio->refcount = 1; | 1237 | dio->refcount = 1; |