public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_copy: accept CRC version of ABTB_MAGIC in ASSERT
@ 2018-01-23 22:59 Eric Sandeen
  2018-01-23 23:15 ` Darrick J. Wong
  2018-01-23 23:35 ` Bill O'Donnell
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2018-01-23 22:59 UTC (permalink / raw)
  To: linux-xfs; +Cc: Radek Burkat

Not sure how this was missed for so long, but to handle CRC
filesystems, this ASSERT on block magic must accept CRC magic
as well.

Reported-by: Radek Burkat <radek@pinkbike.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

(yes, it's > 80 cols but .. so is most of this indented 
code block o_O)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index fb37375..16ee4d9 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -1140,7 +1140,8 @@ main(int argc, char **argv)
 				 ((char *) btree_buf.data +
 				  pos - btree_buf.position);
 
-			ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC);
+			ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC ||
+			       be32_to_cpu(block->bb_magic) == XFS_ABTB_CRC_MAGIC);
 		}
 
 		/*


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_copy: accept CRC version of ABTB_MAGIC in ASSERT
  2018-01-23 22:59 [PATCH] xfs_copy: accept CRC version of ABTB_MAGIC in ASSERT Eric Sandeen
@ 2018-01-23 23:15 ` Darrick J. Wong
  2018-01-23 23:35 ` Bill O'Donnell
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2018-01-23 23:15 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs, Radek Burkat

On Tue, Jan 23, 2018 at 04:59:52PM -0600, Eric Sandeen wrote:
> Not sure how this was missed for so long, but to handle CRC
> filesystems, this ASSERT on block magic must accept CRC magic
> as well.
> 
> Reported-by: Radek Burkat <radek@pinkbike.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

I was /about/ to squawk about 'just use the allocbt verifier' but then
remembered that we don't use the xfs_buf infrastructure...

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

> ---
> 
> (yes, it's > 80 cols but .. so is most of this indented 
> code block o_O)
> 
> diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
> index fb37375..16ee4d9 100644
> --- a/copy/xfs_copy.c
> +++ b/copy/xfs_copy.c
> @@ -1140,7 +1140,8 @@ main(int argc, char **argv)
>  				 ((char *) btree_buf.data +
>  				  pos - btree_buf.position);
>  
> -			ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC);
> +			ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC ||
> +			       be32_to_cpu(block->bb_magic) == XFS_ABTB_CRC_MAGIC);
>  		}
>  
>  		/*
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_copy: accept CRC version of ABTB_MAGIC in ASSERT
  2018-01-23 22:59 [PATCH] xfs_copy: accept CRC version of ABTB_MAGIC in ASSERT Eric Sandeen
  2018-01-23 23:15 ` Darrick J. Wong
@ 2018-01-23 23:35 ` Bill O'Donnell
  1 sibling, 0 replies; 3+ messages in thread
From: Bill O'Donnell @ 2018-01-23 23:35 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs, Radek Burkat

On Tue, Jan 23, 2018 at 04:59:52PM -0600, Eric Sandeen wrote:
> Not sure how this was missed for so long, but to handle CRC
> filesystems, this ASSERT on block magic must accept CRC magic
> as well.
> 
> Reported-by: Radek Burkat <radek@pinkbike.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> ---
> 
> (yes, it's > 80 cols but .. so is most of this indented 
> code block o_O)
> 
> diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
> index fb37375..16ee4d9 100644
> --- a/copy/xfs_copy.c
> +++ b/copy/xfs_copy.c
> @@ -1140,7 +1140,8 @@ main(int argc, char **argv)
>  				 ((char *) btree_buf.data +
>  				  pos - btree_buf.position);
>  
> -			ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC);
> +			ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC ||
> +			       be32_to_cpu(block->bb_magic) == XFS_ABTB_CRC_MAGIC);
>  		}
>  
>  		/*
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-23 23:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 22:59 [PATCH] xfs_copy: accept CRC version of ABTB_MAGIC in ASSERT Eric Sandeen
2018-01-23 23:15 ` Darrick J. Wong
2018-01-23 23:35 ` Bill O'Donnell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox