Originally this function used to always return -EFSCORRUPTED on error but now we're trying to return more informative error codes. Unfortunately, there was one error path missed. If this kmem_alloc() allocation fails then we need to return -ENOMEM instead of success. Fixes: f20192991d79 ("xfs: simplify inode flush error handling") Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> --- fs/xfs/xfs_inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ab31a5dec7aab..63aeda7cbafb0 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3505,8 +3505,10 @@ xfs_iflush_cluster( cilist_size = igeo->inodes_per_cluster * sizeof(struct xfs_inode *); cilist = kmem_alloc(cilist_size, KM_MAYFAIL|KM_NOFS); - if (!cilist) + if (!cilist) { + error = -ENOMEM; goto out_put; + } mask = ~(igeo->inodes_per_cluster - 1); first_index = XFS_INO_TO_AGINO(mp, ip->i_ino) & mask; -- 2.26.2