Message ID | 1499462881-4238-2-git-send-email-agruenba@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jul 07, 2017 at 11:27:59PM +0200, Andreas Gruenbacher wrote: > Add back the inode locking that "ext4: Switch to iomap for SEEK_HOLE / > SEEK_DATA" blew away. We can use inode_lock_shared instead of > inode_lock instead, though. should be folded into that patch.
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 02bbf2c..699a676 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -459,10 +459,14 @@ loff_t ext4_llseek(struct file *file, loff_t offset, int whence) return generic_file_llseek_size(file, offset, whence, maxbytes, i_size_read(inode)); case SEEK_HOLE: + inode_lock_shared(inode); offset = iomap_seek_hole(inode, offset, &ext4_iomap_ops); + inode_unlock_shared(inode); break; case SEEK_DATA: + inode_lock_shared(inode); offset = iomap_seek_data(inode, offset, &ext4_iomap_ops); + inode_unlock_shared(inode); break; }
Add back the inode locking that "ext4: Switch to iomap for SEEK_HOLE / SEEK_DATA" blew away. We can use inode_lock_shared instead of inode_lock instead, though. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> --- fs/ext4/file.c | 4 ++++ 1 file changed, 4 insertions(+)