Skip to content

Commit 98e44e2

Browse files
Christoph HellwigChandan Babu R
authored andcommitted
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Chandan Babu R <[email protected]>
1 parent 5d3ca62 commit 98e44e2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fs/xfs/xfs_file.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,14 +1175,17 @@ xfs_dir_open(
11751175
return error;
11761176
}
11771177

1178+
/*
1179+
* Don't bother propagating errors. We're just doing cleanup, and the caller
1180+
* ignores the return value anyway.
1181+
*/
11781182
STATIC int
11791183
xfs_file_release(
11801184
struct inode *inode,
11811185
struct file *file)
11821186
{
11831187
struct xfs_inode *ip = XFS_I(inode);
11841188
struct xfs_mount *mp = ip->i_mount;
1185-
int error;
11861189

11871190
/* If this is a read-only mount, don't generate I/O */
11881191
if (xfs_is_readonly(mp))
@@ -1200,11 +1203,8 @@ xfs_file_release(
12001203
if (!xfs_is_shutdown(mp) &&
12011204
xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED)) {
12021205
xfs_iflags_clear(ip, XFS_IDIRTY_RELEASE);
1203-
if (ip->i_delayed_blks > 0) {
1204-
error = filemap_flush(inode->i_mapping);
1205-
if (error)
1206-
return error;
1207-
}
1206+
if (ip->i_delayed_blks > 0)
1207+
filemap_flush(inode->i_mapping);
12081208
}
12091209

12101210
/*
@@ -1238,14 +1238,14 @@ xfs_file_release(
12381238
* dirty close we will still remove the speculative
12391239
* allocation, but after that we will leave it in place.
12401240
*/
1241-
error = xfs_free_eofblocks(ip);
1242-
if (!error && ip->i_delayed_blks)
1241+
xfs_free_eofblocks(ip);
1242+
if (ip->i_delayed_blks)
12431243
xfs_iflags_set(ip, XFS_IDIRTY_RELEASE);
12441244
}
12451245
xfs_iunlock(ip, XFS_IOLOCK_EXCL);
12461246
}
12471247

1248-
return error;
1248+
return 0;
12491249
}
12501250

12511251
STATIC int

0 commit comments

Comments
 (0)