summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-08-13 10:39:36 +0300
committerChandan Babu R <chandanbabu@kernel.org>2024-09-03 07:37:38 +0300
commit98e44e2bc0fb15230b10f375db55e4b0bbc295aa (patch)
treefa11f925f12477e47fd1d98849c22684409c74b7 /fs/xfs/xfs_file.c
parent5d3ca6261121486d4665816622ec1974bf4cb8b2 (diff)
downloadlinux-98e44e2bc0fb15230b10f375db55e4b0bbc295aa.tar.xz
xfs: don't bother returning errors from xfs_file_release
While ->release returns int, the only caller ignores the return value. As we're only doing cleanup work there isn't much of a point in return a value to start with, so just document the situation instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r--fs/xfs/xfs_file.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 11732fe1c657..17dfbaca1c58 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1175,6 +1175,10 @@ xfs_dir_open(
return error;
}
+/*
+ * Don't bother propagating errors. We're just doing cleanup, and the caller
+ * ignores the return value anyway.
+ */
STATIC int
xfs_file_release(
struct inode *inode,
@@ -1182,7 +1186,6 @@ xfs_file_release(
{
struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount;
- int error;
/* If this is a read-only mount, don't generate I/O */
if (xfs_is_readonly(mp))
@@ -1200,11 +1203,8 @@ xfs_file_release(
if (!xfs_is_shutdown(mp) &&
xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED)) {
xfs_iflags_clear(ip, XFS_IDIRTY_RELEASE);
- if (ip->i_delayed_blks > 0) {
- error = filemap_flush(inode->i_mapping);
- if (error)
- return error;
- }
+ if (ip->i_delayed_blks > 0)
+ filemap_flush(inode->i_mapping);
}
/*
@@ -1238,14 +1238,14 @@ xfs_file_release(
* dirty close we will still remove the speculative
* allocation, but after that we will leave it in place.
*/
- error = xfs_free_eofblocks(ip);
- if (!error && ip->i_delayed_blks)
+ xfs_free_eofblocks(ip);
+ if (ip->i_delayed_blks)
xfs_iflags_set(ip, XFS_IDIRTY_RELEASE);
}
xfs_iunlock(ip, XFS_IOLOCK_EXCL);
}
- return error;
+ return 0;
}
STATIC int