Skip to contentSkip to conversation

ext4: use i_size_read in ext4_unaligned_aio()

PATCH In review Theodore Ts'o 2 participants 2 messages Apr 12, 2014 – Apr 13, 2014 ext4 file system

lore
Share & tools
lore

Theodore Ts'o

author maintainer
#0 lore raw

PATCH 1/1 ext4: use i_size_read in ext4_unaligned_aio()

We haven't taken i_mutex yet, so we need to use i_size_read().

---
 fs/ext4/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/file.c +1 -1
index 6db7f7d..bc76559 100644
@@ -82,7 +82,7 @@ ext4_unaligned_aio(struct inode *inode, const struct iovec *iov,
 	size_t count = iov_length(iov, nr_segs);
 	loff_t final_size = pos + count;
 
-	if (pos >= inode->i_size)
+	if (pos >= i_size_read(inode))
 		return 0;
 
 	if ((pos & blockmask) || (final_size & blockmask))
Signature · 1 line
1.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Theodore Ts'o

We haven't taken i_mutex yet, so we need to use i_size_read().

- Zheng

Quoted 24 lines
---
 fs/ext4/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/file.c +1 -1
index 6db7f7d..bc76559 100644
@@ -82,7 +82,7 @@ ext4_unaligned_aio(struct inode *inode, const struct iovec *iov,
 	size_t count = iov_length(iov, nr_segs);
 	loff_t final_size = pos + count;
 
-	if (pos >= inode->i_size)
+	if (pos >= i_size_read(inode))
 		return 0;
 
 	if ((pos & blockmask) || (final_size & blockmask))
Signature · 6 lines
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html