mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
f2fs: fix inode rwsem regression
This is similar to942491c9e6("xfs: fix AIM7 regression") Apparently our current rwsem code doesn't like doing the trylock, then lock for real scheme. So change our read/write methods to just do the trylock for the RWF_NOWAIT case. We don't need a check for IOCB_NOWAIT and !direct-IO because it is checked in generic_write_checks(). Fixes:b91050a80c("f2fs: add nowait aio support") Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
committed by
Jaegeuk Kim
parent
80b3dc7dd9
commit
7952493d75
@@ -3322,11 +3322,12 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!inode_trylock(inode)) {
|
||||
if (iocb->ki_flags & IOCB_NOWAIT) {
|
||||
if (iocb->ki_flags & IOCB_NOWAIT) {
|
||||
if (!inode_trylock(inode)) {
|
||||
ret = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
inode_lock(inode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user