All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
@ 2015-03-12  5:40 Liu Bo
  2015-03-12  5:45 ` Qu Wenruo
  2015-03-12 17:25 ` [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" David Sterba
  0 siblings, 2 replies; 11+ messages in thread
From: Liu Bo @ 2015-03-12  5:40 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Eryu Guan

This reverts commit 667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007.

This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
and it also allows us to mount a buggy btrfs if this btrfs has the right
superblock head part but has something wrong with chunk tree part[1], and
after that we can hit BUG_ON()s set in the code to prevent something
impossible.

Since David has gave us "Btrfs progs v3.19-rc2", just remove the check,
if anyone who wants to make a fresh btrfs, please use the latest one.

[1]: http://www.spinics.net/lists/linux-btrfs/msg42358.html

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Conflicts:
	fs/btrfs/disk-io.c
---
 fs/btrfs/disk-io.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 41b320e..f63aacf 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -418,12 +418,6 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
 
 		if (memcmp(raw_disk_sb, result, csum_size))
 			ret = 1;
-
-		if (ret && btrfs_super_generation(disk_sb) < 10) {
-			printk(KERN_WARNING
-				"BTRFS: super block crcs don't match, older mkfs detected\n");
-			ret = 0;
-		}
 	}
 
 	if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
-- 
1.8.1.4


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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-12  5:40 [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" Liu Bo
@ 2015-03-12  5:45 ` Qu Wenruo
  2015-03-12 17:34   ` David Sterba
  2015-03-12 17:25 ` [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" David Sterba
  1 sibling, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2015-03-12  5:45 UTC (permalink / raw)
  To: Liu Bo, linux-btrfs; +Cc: Eryu Guan


I sent such patch some time ago but was rejected by Chris,
hopes this time it can be accepted.

This one can make btrfs much more robust.

Thanks,
Qu
-------- Original Message  --------
Subject: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
From: Liu Bo <bo.li.liu@oracle.com>
To: <linux-btrfs@vger.kernel.org>
Date: 2015年03月12日 13:40

> This reverts commit 667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007.
>
> This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
> and it also allows us to mount a buggy btrfs if this btrfs has the right
> superblock head part but has something wrong with chunk tree part[1], and
> after that we can hit BUG_ON()s set in the code to prevent something
> impossible.
>
> Since David has gave us "Btrfs progs v3.19-rc2", just remove the check,
> if anyone who wants to make a fresh btrfs, please use the latest one.
>
> [1]: http://www.spinics.net/lists/linux-btrfs/msg42358.html
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
>
> Conflicts:
> 	fs/btrfs/disk-io.c
> ---
>   fs/btrfs/disk-io.c | 6 ------
>   1 file changed, 6 deletions(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 41b320e..f63aacf 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -418,12 +418,6 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
>
>   		if (memcmp(raw_disk_sb, result, csum_size))
>   			ret = 1;
> -
> -		if (ret && btrfs_super_generation(disk_sb) < 10) {
> -			printk(KERN_WARNING
> -				"BTRFS: super block crcs don't match, older mkfs detected\n");
> -			ret = 0;
> -		}
>   	}
>
>   	if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
>

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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-12  5:40 [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" Liu Bo
  2015-03-12  5:45 ` Qu Wenruo
@ 2015-03-12 17:25 ` David Sterba
  2015-03-12 20:09   ` Liu Bo
  1 sibling, 1 reply; 11+ messages in thread
From: David Sterba @ 2015-03-12 17:25 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs, Eryu Guan

On Thu, Mar 12, 2015 at 01:40:47PM +0800, Liu Bo wrote:
> This reverts commit 667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007.
> 
> This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
> and it also allows us to mount a buggy btrfs if this btrfs has the right
> superblock head part but has something wrong with chunk tree part[1], and
> after that we can hit BUG_ON()s set in the code to prevent something
> impossible.
> 
> Since David has gave us "Btrfs progs v3.19-rc2", just remove the check,
> if anyone who wants to make a fresh btrfs, please use the latest one.

I think the fixed progs are out long enough and the combination of
really old progs + really new kernel is very uncommon and we don't need
to care about that anymore.

However, please do not do it as a revert, it's a normal patch although
it effectively reverts some other patch.

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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-12  5:45 ` Qu Wenruo
@ 2015-03-12 17:34   ` David Sterba
  2015-03-12 20:15     ` Liu Bo
  0 siblings, 1 reply; 11+ messages in thread
From: David Sterba @ 2015-03-12 17:34 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Liu Bo, linux-btrfs, Eryu Guan

On Thu, Mar 12, 2015 at 01:45:05PM +0800, Qu Wenruo wrote:
> I sent such patch some time ago but was rejected by Chris,
> hopes this time it can be accepted.

http://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg34937.html

I'm OK with removing the special case now because there are additional
supreblock checks merged (3.19) that were motivated by your previous
attempt to remove it.

o btrfs: add more checks to btrfs_read_sys_array
o btrfs: cleanup, rename a few variables in btrfs_read_sys_array
o btrfs: add checks for sys_chunk_array sizes
o btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize



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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-12 17:25 ` [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" David Sterba
@ 2015-03-12 20:09   ` Liu Bo
  0 siblings, 0 replies; 11+ messages in thread
From: Liu Bo @ 2015-03-12 20:09 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs, Eryu Guan

On Thu, Mar 12, 2015 at 06:25:13PM +0100, David Sterba wrote:
> On Thu, Mar 12, 2015 at 01:40:47PM +0800, Liu Bo wrote:
> > This reverts commit 667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007.
> > 
> > This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
> > and it also allows us to mount a buggy btrfs if this btrfs has the right
> > superblock head part but has something wrong with chunk tree part[1], and
> > after that we can hit BUG_ON()s set in the code to prevent something
> > impossible.
> > 
> > Since David has gave us "Btrfs progs v3.19-rc2", just remove the check,
> > if anyone who wants to make a fresh btrfs, please use the latest one.
> 
> I think the fixed progs are out long enough and the combination of
> really old progs + really new kernel is very uncommon and we don't need
> to care about that anymore.
> 
> However, please do not do it as a revert, it's a normal patch although
> it effectively reverts some other patch.

Okay, I'll update this ASAP, thanks for your review.

Thanks,

-liubo

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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-12 17:34   ` David Sterba
@ 2015-03-12 20:15     ` Liu Bo
  2015-03-16 16:25       ` David Sterba
  0 siblings, 1 reply; 11+ messages in thread
From: Liu Bo @ 2015-03-12 20:15 UTC (permalink / raw)
  To: dsterba; +Cc: Qu Wenruo, linux-btrfs, Eryu Guan

On Thu, Mar 12, 2015 at 06:34:15PM +0100, David Sterba wrote:
> On Thu, Mar 12, 2015 at 01:45:05PM +0800, Qu Wenruo wrote:
> > I sent such patch some time ago but was rejected by Chris,
> > hopes this time it can be accepted.
> 
> http://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg34937.html
> 
> I'm OK with removing the special case now because there are additional
> supreblock checks merged (3.19) that were motivated by your previous
> attempt to remove it.

So David, are you going to take the above patch instead?

I'm okay with that since they're exactly same, but it'd be good that Qu has its commit log updated.

Thanks,

-liubo

> 
> o btrfs: add more checks to btrfs_read_sys_array
> o btrfs: cleanup, rename a few variables in btrfs_read_sys_array
> o btrfs: add checks for sys_chunk_array sizes
> o btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize
> 
> 

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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-12 20:15     ` Liu Bo
@ 2015-03-16 16:25       ` David Sterba
  2015-03-17  2:41         ` Qu Wenruo
  2015-03-17  6:34         ` [PATCH v2] Btrfs: Remove the check for old-style mkfs Liu Bo
  0 siblings, 2 replies; 11+ messages in thread
From: David Sterba @ 2015-03-16 16:25 UTC (permalink / raw)
  To: Liu Bo; +Cc: dsterba, Qu Wenruo, linux-btrfs, Eryu Guan

On Fri, Mar 13, 2015 at 04:15:08AM +0800, Liu Bo wrote:
> On Thu, Mar 12, 2015 at 06:34:15PM +0100, David Sterba wrote:
> > On Thu, Mar 12, 2015 at 01:45:05PM +0800, Qu Wenruo wrote:
> > > I sent such patch some time ago but was rejected by Chris,
> > > hopes this time it can be accepted.
> > 
> > http://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg34937.html
> > 
> > I'm OK with removing the special case now because there are additional
> > supreblock checks merged (3.19) that were motivated by your previous
> > attempt to remove it.
> 
> So David, are you going to take the above patch instead?
> 
> I'm okay with that since they're exactly same, but it'd be good that
> Qu has its commit log updated.

Although Qu's patch was first and should be normally applied in case
more patches doing the same thing, the changelog reasoning is IMHO not
all fine, so I'm inclined to take your patch if you refine the subject,
and drop the "Conflicts:". Thanks.

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

* Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs"
  2015-03-16 16:25       ` David Sterba
@ 2015-03-17  2:41         ` Qu Wenruo
  2015-03-17  6:34         ` [PATCH v2] Btrfs: Remove the check for old-style mkfs Liu Bo
  1 sibling, 0 replies; 11+ messages in thread
From: Qu Wenruo @ 2015-03-17  2:41 UTC (permalink / raw)
  To: dsterba, Liu Bo, linux-btrfs, Eryu Guan



-------- Original Message  --------
Subject: Re: [PATCH] Revert "Btrfs: allow superblock mismatch from older 
mkfs"
From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>
Date: 2015年03月17日 00:25

> On Fri, Mar 13, 2015 at 04:15:08AM +0800, Liu Bo wrote:
>> On Thu, Mar 12, 2015 at 06:34:15PM +0100, David Sterba wrote:
>>> On Thu, Mar 12, 2015 at 01:45:05PM +0800, Qu Wenruo wrote:
>>>> I sent such patch some time ago but was rejected by Chris,
>>>> hopes this time it can be accepted.
>>>
>>> http://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg34937.html
>>>
>>> I'm OK with removing the special case now because there are additional
>>> supreblock checks merged (3.19) that were motivated by your previous
>>> attempt to remove it.
>>
>> So David, are you going to take the above patch instead?
>>
>> I'm okay with that since they're exactly same, but it'd be good that
>> Qu has its commit log updated.
>
> Although Qu's patch was first and should be normally applied in case
> more patches doing the same thing, the changelog reasoning is IMHO not
> all fine, so I'm inclined to take your patch if you refine the subject,
> and drop the "Conflicts:". Thanks.
>
I'm completely OK with picking Liu's patch, since his patch is submitted 
at a much more appropriate time than mine.
My patch is somewhat too early.

Thanks,
Qu

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

* [PATCH v2] Btrfs: Remove the check for old-style mkfs
  2015-03-16 16:25       ` David Sterba
  2015-03-17  2:41         ` Qu Wenruo
@ 2015-03-17  6:34         ` Liu Bo
  2015-03-17  7:13           ` Omar Sandoval
  2015-03-17 10:11           ` David Sterba
  1 sibling, 2 replies; 11+ messages in thread
From: Liu Bo @ 2015-03-17  6:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
but it also allows us to mount a buggy btrfs if this btrfs has the right
superblock head part but has something wrong with chunk tree part[1], and
after that we can hit BUG_ON()s set in the code to prevent something
impossible.

Since David has released "Btrfs progs v3.19-rc2", just remove the check,
if anyone who wants to make a fresh btrfs, please use the latest one.

[1]: http://www.spinics.net/lists/linux-btrfs/msg42358.html

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
v2: Refine the patch subject.

 fs/btrfs/disk-io.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 41b320e..f63aacf 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -418,12 +418,6 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
 
 		if (memcmp(raw_disk_sb, result, csum_size))
 			ret = 1;
-
-		if (ret && btrfs_super_generation(disk_sb) < 10) {
-			printk(KERN_WARNING
-				"BTRFS: super block crcs don't match, older mkfs detected\n");
-			ret = 0;
-		}
 	}
 
 	if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
-- 
1.8.1.4


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

* Re: [PATCH v2] Btrfs: Remove the check for old-style mkfs
  2015-03-17  6:34         ` [PATCH v2] Btrfs: Remove the check for old-style mkfs Liu Bo
@ 2015-03-17  7:13           ` Omar Sandoval
  2015-03-17 10:11           ` David Sterba
  1 sibling, 0 replies; 11+ messages in thread
From: Omar Sandoval @ 2015-03-17  7:13 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs, David Sterba

On Tue, Mar 17, 2015 at 02:34:16PM +0800, Liu Bo wrote:
> This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
> but it also allows us to mount a buggy btrfs if this btrfs has the right
> superblock head part but has something wrong with chunk tree part[1], and
> after that we can hit BUG_ON()s set in the code to prevent something
> impossible.
> 
> Since David has released "Btrfs progs v3.19-rc2", just remove the check,
> if anyone who wants to make a fresh btrfs, please use the latest one.
> 
> [1]: http://www.spinics.net/lists/linux-btrfs/msg42358.html
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

# mount -o loop btrfs.img /mnt/test
# dmesg | tail
[   28.582698] BTRFS: device fsid 1c0ed5d6-550d-4010-b1b4-ce1828270713 devid 1 transid 4 /dev/loop0
[   28.598365] BTRFS: superblock checksum mismatch
[   28.617205] BTRFS: open_ctree failed

Looks good to me.

Reviewed-by: Omar Sandoval <osandov@osandov.com>

> ---
> v2: Refine the patch subject.
> 
>  fs/btrfs/disk-io.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 41b320e..f63aacf 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -418,12 +418,6 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
>  
>  		if (memcmp(raw_disk_sb, result, csum_size))
>  			ret = 1;
> -
> -		if (ret && btrfs_super_generation(disk_sb) < 10) {
> -			printk(KERN_WARNING
> -				"BTRFS: super block crcs don't match, older mkfs detected\n");
> -			ret = 0;
> -		}
>  	}
>  
>  	if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
> -- 
> 1.8.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Omar

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

* Re: [PATCH v2] Btrfs: Remove the check for old-style mkfs
  2015-03-17  6:34         ` [PATCH v2] Btrfs: Remove the check for old-style mkfs Liu Bo
  2015-03-17  7:13           ` Omar Sandoval
@ 2015-03-17 10:11           ` David Sterba
  1 sibling, 0 replies; 11+ messages in thread
From: David Sterba @ 2015-03-17 10:11 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Tue, Mar 17, 2015 at 02:34:16PM +0800, Liu Bo wrote:
> This was used to make sure that a fresh btrfs from an older mkfs.btrfs,
> but it also allows us to mount a buggy btrfs if this btrfs has the right
> superblock head part but has something wrong with chunk tree part[1], and
> after that we can hit BUG_ON()s set in the code to prevent something
> impossible.
> 
> Since David has released "Btrfs progs v3.19-rc2", just remove the check,
> if anyone who wants to make a fresh btrfs, please use the latest one.
> 
> [1]: http://www.spinics.net/lists/linux-btrfs/msg42358.html
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.cz>

Thanks.

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

end of thread, other threads:[~2015-03-17 10:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12  5:40 [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" Liu Bo
2015-03-12  5:45 ` Qu Wenruo
2015-03-12 17:34   ` David Sterba
2015-03-12 20:15     ` Liu Bo
2015-03-16 16:25       ` David Sterba
2015-03-17  2:41         ` Qu Wenruo
2015-03-17  6:34         ` [PATCH v2] Btrfs: Remove the check for old-style mkfs Liu Bo
2015-03-17  7:13           ` Omar Sandoval
2015-03-17 10:11           ` David Sterba
2015-03-12 17:25 ` [PATCH] Revert "Btrfs: allow superblock mismatch from older mkfs" David Sterba
2015-03-12 20:09   ` Liu Bo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.