Skip to content

Commit

Permalink
hold i_mutex for inode in zpl_aio_write
Browse files Browse the repository at this point in the history
  • Loading branch information
snajpa committed Sep 5, 2019
1 parent 267cb6b commit 3089152
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions module/zfs/zpl_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,22 @@ zpl_aio_write(struct kiocb *kiocb, const struct iovec *iovp,
size_t count;
ssize_t ret;

mutex_lock(&ip->i_mutex);

ret = generic_segment_checks(iovp, &nr_segs, &count, VERIFY_READ);
if (ret)
return (ret);
goto out;

ret = generic_write_checks(file, &pos, &count, isblk);
if (ret)
return (ret);
goto out;

return (zpl_iter_write_common(kiocb, iovp, nr_segs, count,
UIO_USERSPACE, 0));
ret = zpl_iter_write_common(kiocb, iovp, nr_segs, count,
UIO_USERSPACE, 0);

out:
mutex_unlock(&ip->i_mutex);
return (ret);
}
#endif /* HAVE_VFS_RW_ITERATE */

Expand Down

0 comments on commit 3089152

Please sign in to comment.