xfs: match lock mode in xfs_buffered_write_iomap_begin()
authorZhang Yi <yi.zhang@huawei.com>
Thu, 25 Apr 2024 13:13:27 +0000 (21:13 +0800)
committerChandan Babu R <chandanbabu@kernel.org>
Mon, 29 Apr 2024 11:53:11 +0000 (17:23 +0530)
commitbb712842a85d595525e72f0e378c143e620b3ea2
treefb80794c036669c4591546c22c526a52057fea0a
parente58ac1770ded2a316447ca7608bb7809af82eca6
xfs: match lock mode in xfs_buffered_write_iomap_begin()

Commit 1aa91d9c9933 ("xfs: Add async buffered write support") replace
xfs_ilock(XFS_ILOCK_EXCL) with xfs_ilock_for_iomap() when locking the
writing inode, and a new variable lockmode is used to indicate the lock
mode. Although the lockmode should always be XFS_ILOCK_EXCL, it's still
better to use this variable instead of useing XFS_ILOCK_EXCL directly
when unlocking the inode.

Fixes: 1aa91d9c9933 ("xfs: Add async buffered write support")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_iomap.c