]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove unnecessary shutdown check from xfs_iflush()
authorBrian Foster <bfoster@redhat.com>
Mon, 10 Aug 2020 20:32:05 +0000 (16:32 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 10 Aug 2020 20:32:05 +0000 (16:32 -0400)
Source kernel commit: 15fab3b9be2255be70ba1c598a11622fa03c9d5e

The shutdown check in xfs_iflush() duplicates checks down in the
buffer code. If the fs is shut down, xfs_trans_read_buf_map() always
returns an error and falls into the same error path. Remove the
unnecessary check along with the warning in xfs_imap_to_bp()
that generates excessive noise in the log if the fs is shut down.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_inode_buf.c

index b65cd0b1a21c597035f9378a18dd65de6e53bc84..e94f5bf70f9dc5ba7b0b970e0c8c9b828a04c29a 100644 (file)
@@ -169,12 +169,7 @@ xfs_imap_to_bp(
                                   (int)imap->im_len, buf_flags, &bp,
                                   &xfs_inode_buf_ops);
        if (error) {
-               if (error == -EAGAIN) {
-                       ASSERT(buf_flags & XBF_TRYLOCK);
-                       return error;
-               }
-               xfs_warn(mp, "%s: xfs_trans_read_buf() returned error %d.",
-                       __func__, error);
+               ASSERT(error != -EAGAIN || (buf_flags & XBF_TRYLOCK));
                return error;
        }