diff mbox series

[4/9] xfs: slightly tweak an assert in xfs_fs_map_blocks

Message ID 20191030180419.13045-5-hch@lst.de (mailing list archive)
State Superseded, archived
Headers show
Series [1/9] xfs: simplify xfs_iomap_eof_align_last_fsb | expand

Commit Message

Christoph Hellwig Oct. 30, 2019, 6:04 p.m. UTC
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>
---
 fs/xfs/xfs_pnfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong Oct. 30, 2019, 7:26 p.m. UTC | #1
On Wed, Oct 30, 2019 at 11:04:14AM -0700, Christoph Hellwig wrote:
> 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>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_pnfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
> index c637f0192976..3634ffff3b07 100644
> --- a/fs/xfs/xfs_pnfs.c
> +++ b/fs/xfs/xfs_pnfs.c
> @@ -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
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
index c637f0192976..3634ffff3b07 100644
--- a/fs/xfs/xfs_pnfs.c
+++ b/fs/xfs/xfs_pnfs.c
@@ -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