]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: slightly tweak an assert in xfs_fs_map_blocks
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Oct 2019 19:24:58 +0000 (12:24 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Nov 2019 18:22:30 +0000 (10:22 -0800)
We should never see delalloc blocks for a pNFS layout, write or not.
Adjust the assert to check for that.

Signed-off-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>
fs/xfs/xfs_pnfs.c

index c637f01929760b7f0abce4f34a8750373f5912c4..3634ffff3b07a667b53a2d7ec6e16a4e54b80e3f 100644 (file)
@@ -148,11 +148,11 @@ xfs_fs_map_blocks(
        if (error)
                goto out_unlock;
 
+       ASSERT(!nimaps || imap.br_startblock != DELAYSTARTBLOCK);
+
        if (write) {
                enum xfs_prealloc_flags flags = 0;
 
-               ASSERT(imap.br_startblock != DELAYSTARTBLOCK);
-
                if (!nimaps || imap.br_startblock == HOLESTARTBLOCK) {
                        /*
                         * xfs_iomap_write_direct() expects to take ownership of