LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
@ 2024-05-07 15:37 Petr Vorel
  2024-05-07 16:01 ` Brian Foster
  2024-05-08  2:08 ` Glass Su
  0 siblings, 2 replies; 9+ messages in thread
From: Petr Vorel @ 2024-05-07 15:37 UTC (permalink / raw
  To: linux-bcachefs
  Cc: Petr Vorel, Kent Overstreet, Su Yue, Brian Foster, Coly Li,
	linux-kernel

Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.

There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
which use UUID_INIT() and are used only in libbcachefs. Therefore move
only BCACHEFS_STATFS_MAGIC value, which can be used outside of
libbcachefs for f_type field in struct statfs in statfs() or fstatfs().

Suggested-by: Su Yue <l@damenly.org>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v2->v3:
* Align tab with other entries.

Changes v1->v2 (all suggested by Brian Foster - thanks!):
* rename constant to BCACHEFS_SUPER_MAGIC,
* keep BCACHEFS_STATFS_MAGIC in bcachefs_format.h, just include
 <uapi/linux/magic.h> and use BCACHEFS_SUPER_MAGIC definition,
* move the constant to the first chunk.

Kind regards,
Petr

 fs/bcachefs/bcachefs_format.h | 3 ++-
 include/uapi/linux/magic.h    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
index f7fbfccd2b1e..3b831415409b 100644
--- a/fs/bcachefs/bcachefs_format.h
+++ b/fs/bcachefs/bcachefs_format.h
@@ -76,6 +76,7 @@
 #include <asm/byteorder.h>
 #include <linux/kernel.h>
 #include <linux/uuid.h>
+#include <uapi/linux/magic.h>
 #include "vstructs.h"
 
 #ifdef __KERNEL__
@@ -1275,7 +1276,7 @@ enum bch_compression_opts {
 	UUID_INIT(0xc68573f6, 0x66ce, 0x90a9,				\
 		  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
 
-#define BCACHEFS_STATFS_MAGIC		0xca451a4e
+#define BCACHEFS_STATFS_MAGIC		BCACHEFS_SUPER_MAGIC
 
 #define JSET_MAGIC		__cpu_to_le64(0x245235c1a3625032ULL)
 #define BSET_MAGIC		__cpu_to_le64(0x90135c78b99e07f5ULL)
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 1b40a968ba91..bb575f3ab45e 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -37,6 +37,7 @@
 #define HOSTFS_SUPER_MAGIC	0x00c0ffee
 #define OVERLAYFS_SUPER_MAGIC	0x794c7630
 #define FUSE_SUPER_MAGIC	0x65735546
+#define BCACHEFS_SUPER_MAGIC	0xca451a4e
 
 #define MINIX_SUPER_MAGIC	0x137F		/* minix v1 fs, 14 char names */
 #define MINIX_SUPER_MAGIC2	0x138F		/* minix v1 fs, 30 char names */
-- 
2.43.0


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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-07 15:37 [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h Petr Vorel
@ 2024-05-07 16:01 ` Brian Foster
  2024-05-07 16:44   ` Petr Vorel
  2024-05-08  2:08 ` Glass Su
  1 sibling, 1 reply; 9+ messages in thread
From: Brian Foster @ 2024-05-07 16:01 UTC (permalink / raw
  To: Petr Vorel; +Cc: linux-bcachefs, Kent Overstreet, Su Yue, Coly Li, linux-kernel

On Tue, May 07, 2024 at 05:37:57PM +0200, Petr Vorel wrote:
> Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.
> 
> There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> which use UUID_INIT() and are used only in libbcachefs. Therefore move
> only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> libbcachefs for f_type field in struct statfs in statfs() or fstatfs().
> 
> Suggested-by: Su Yue <l@damenly.org>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---

I was thinking you'd just rename the STATFS_MAGIC def locally as well,
but whatever.. LGTM, thanks for the tweaks!

Acked-by: Brian Foster <bfoster@redhat.com>

> Changes v2->v3:
> * Align tab with other entries.
> 
> Changes v1->v2 (all suggested by Brian Foster - thanks!):
> * rename constant to BCACHEFS_SUPER_MAGIC,
> * keep BCACHEFS_STATFS_MAGIC in bcachefs_format.h, just include
>  <uapi/linux/magic.h> and use BCACHEFS_SUPER_MAGIC definition,
> * move the constant to the first chunk.
> 
> Kind regards,
> Petr
> 
>  fs/bcachefs/bcachefs_format.h | 3 ++-
>  include/uapi/linux/magic.h    | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
> index f7fbfccd2b1e..3b831415409b 100644
> --- a/fs/bcachefs/bcachefs_format.h
> +++ b/fs/bcachefs/bcachefs_format.h
> @@ -76,6 +76,7 @@
>  #include <asm/byteorder.h>
>  #include <linux/kernel.h>
>  #include <linux/uuid.h>
> +#include <uapi/linux/magic.h>
>  #include "vstructs.h"
>  
>  #ifdef __KERNEL__
> @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
>  	UUID_INIT(0xc68573f6, 0x66ce, 0x90a9,				\
>  		  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
>  
> -#define BCACHEFS_STATFS_MAGIC		0xca451a4e
> +#define BCACHEFS_STATFS_MAGIC		BCACHEFS_SUPER_MAGIC
>  
>  #define JSET_MAGIC		__cpu_to_le64(0x245235c1a3625032ULL)
>  #define BSET_MAGIC		__cpu_to_le64(0x90135c78b99e07f5ULL)
> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> index 1b40a968ba91..bb575f3ab45e 100644
> --- a/include/uapi/linux/magic.h
> +++ b/include/uapi/linux/magic.h
> @@ -37,6 +37,7 @@
>  #define HOSTFS_SUPER_MAGIC	0x00c0ffee
>  #define OVERLAYFS_SUPER_MAGIC	0x794c7630
>  #define FUSE_SUPER_MAGIC	0x65735546
> +#define BCACHEFS_SUPER_MAGIC	0xca451a4e
>  
>  #define MINIX_SUPER_MAGIC	0x137F		/* minix v1 fs, 14 char names */
>  #define MINIX_SUPER_MAGIC2	0x138F		/* minix v1 fs, 30 char names */
> -- 
> 2.43.0
> 


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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-07 16:01 ` Brian Foster
@ 2024-05-07 16:44   ` Petr Vorel
  2024-05-08  2:27     ` Kent Overstreet
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2024-05-07 16:44 UTC (permalink / raw
  To: Brian Foster
  Cc: linux-bcachefs, Kent Overstreet, Su Yue, Coly Li, linux-kernel

> On Tue, May 07, 2024 at 05:37:57PM +0200, Petr Vorel wrote:
> > Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> > BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> > definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.

> > There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> > which use UUID_INIT() and are used only in libbcachefs. Therefore move
> > only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> > libbcachefs for f_type field in struct statfs in statfs() or fstatfs().

> > Suggested-by: Su Yue <l@damenly.org>
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---

> I was thinking you'd just rename the STATFS_MAGIC def locally as well,
> but whatever.. LGTM, thanks for the tweaks!

Ah, I thought it'd be more readable this way from bcachefs point.
Kent, just let me know if you prefer Brian's way and I'll send v4.

Kind regards,
Petr

> Acked-by: Brian Foster <bfoster@redhat.com>

> > Changes v2->v3:
> > * Align tab with other entries.

> > Changes v1->v2 (all suggested by Brian Foster - thanks!):
> > * rename constant to BCACHEFS_SUPER_MAGIC,
> > * keep BCACHEFS_STATFS_MAGIC in bcachefs_format.h, just include
> >  <uapi/linux/magic.h> and use BCACHEFS_SUPER_MAGIC definition,
> > * move the constant to the first chunk.

> > Kind regards,
> > Petr

> >  fs/bcachefs/bcachefs_format.h | 3 ++-
> >  include/uapi/linux/magic.h    | 1 +
> >  2 files changed, 3 insertions(+), 1 deletion(-)

> > diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
> > index f7fbfccd2b1e..3b831415409b 100644
> > --- a/fs/bcachefs/bcachefs_format.h
> > +++ b/fs/bcachefs/bcachefs_format.h
> > @@ -76,6 +76,7 @@
> >  #include <asm/byteorder.h>
> >  #include <linux/kernel.h>
> >  #include <linux/uuid.h>
> > +#include <uapi/linux/magic.h>
> >  #include "vstructs.h"

> >  #ifdef __KERNEL__
> > @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
> >  	UUID_INIT(0xc68573f6, 0x66ce, 0x90a9,				\
> >  		  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)

> > -#define BCACHEFS_STATFS_MAGIC		0xca451a4e
> > +#define BCACHEFS_STATFS_MAGIC		BCACHEFS_SUPER_MAGIC

> >  #define JSET_MAGIC		__cpu_to_le64(0x245235c1a3625032ULL)
> >  #define BSET_MAGIC		__cpu_to_le64(0x90135c78b99e07f5ULL)
> > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> > index 1b40a968ba91..bb575f3ab45e 100644
> > --- a/include/uapi/linux/magic.h
> > +++ b/include/uapi/linux/magic.h
> > @@ -37,6 +37,7 @@
> >  #define HOSTFS_SUPER_MAGIC	0x00c0ffee
> >  #define OVERLAYFS_SUPER_MAGIC	0x794c7630
> >  #define FUSE_SUPER_MAGIC	0x65735546
> > +#define BCACHEFS_SUPER_MAGIC	0xca451a4e

> >  #define MINIX_SUPER_MAGIC	0x137F		/* minix v1 fs, 14 char names */
> >  #define MINIX_SUPER_MAGIC2	0x138F		/* minix v1 fs, 30 char names */
> > -- 
> > 2.43.0



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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-07 15:37 [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h Petr Vorel
  2024-05-07 16:01 ` Brian Foster
@ 2024-05-08  2:08 ` Glass Su
  2024-05-08 21:17   ` Petr Vorel
  1 sibling, 1 reply; 9+ messages in thread
From: Glass Su @ 2024-05-08  2:08 UTC (permalink / raw
  To: Petr Vorel
  Cc: linux-bcachefs, Kent Overstreet, Su Yue, Brian Foster, Coly Li,
	linux-kernel



> On May 7, 2024, at 23:37, Petr Vorel <pvorel@suse.cz> wrote:
> 
> Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.
> 
> There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> which use UUID_INIT() and are used only in libbcachefs. Therefore move
> only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> libbcachefs for f_type field in struct statfs in statfs() or fstatfs().
> 
> Suggested-by: Su Yue <l@damenly.org>

Would you kindly amend it to Su Yue <glass.su@suse.com> or
Kent can help if the patch is going to be applied.

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Changes v2->v3:
> * Align tab with other entries.
> 
> Changes v1->v2 (all suggested by Brian Foster - thanks!):
> * rename constant to BCACHEFS_SUPER_MAGIC,
> * keep BCACHEFS_STATFS_MAGIC in bcachefs_format.h, just include
> <uapi/linux/magic.h> and use BCACHEFS_SUPER_MAGIC definition,
> * move the constant to the first chunk.
> 
> Kind regards,
> Petr
> 
> fs/bcachefs/bcachefs_format.h | 3 ++-
> include/uapi/linux/magic.h    | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
> index f7fbfccd2b1e..3b831415409b 100644
> --- a/fs/bcachefs/bcachefs_format.h
> +++ b/fs/bcachefs/bcachefs_format.h
> @@ -76,6 +76,7 @@
> #include <asm/byteorder.h>
> #include <linux/kernel.h>
> #include <linux/uuid.h>
> +#include <uapi/linux/magic.h>
> #include "vstructs.h"
> 
> #ifdef __KERNEL__
> @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
> UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \
>  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
> 
> -#define BCACHEFS_STATFS_MAGIC 0xca451a4e
> +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC
> 
> #define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL)
> #define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL)
> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> index 1b40a968ba91..bb575f3ab45e 100644
> --- a/include/uapi/linux/magic.h
> +++ b/include/uapi/linux/magic.h
> @@ -37,6 +37,7 @@
> #define HOSTFS_SUPER_MAGIC 0x00c0ffee
> #define OVERLAYFS_SUPER_MAGIC 0x794c7630
> #define FUSE_SUPER_MAGIC 0x65735546
> +#define BCACHEFS_SUPER_MAGIC 0xca451a4e

IIUC, due to some historical reasons bcachefs used to switched
ondisk sb magic from BCACHE_MAGIC to BCHFS_MAGIC.
Other major fses uses  *_SUPER_MAGIC both for ondisk 
sb magic, kstatfs::f_type and super_block::s_magic.
However, for bcacehfs there are three magic numbers.

Anyway, it looks good to me so far:
Reviewed-by: Su Yue <glass.su@suse.com> 

— 
Su

> #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
> #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
> -- 
> 2.43.0
> 
> 


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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-07 16:44   ` Petr Vorel
@ 2024-05-08  2:27     ` Kent Overstreet
  0 siblings, 0 replies; 9+ messages in thread
From: Kent Overstreet @ 2024-05-08  2:27 UTC (permalink / raw
  To: Petr Vorel; +Cc: Brian Foster, linux-bcachefs, Su Yue, Coly Li, linux-kernel

On Tue, May 07, 2024 at 06:44:30PM +0200, Petr Vorel wrote:
> > On Tue, May 07, 2024 at 05:37:57PM +0200, Petr Vorel wrote:
> > > Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> > > BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> > > definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.
> 
> > > There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> > > which use UUID_INIT() and are used only in libbcachefs. Therefore move
> > > only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> > > libbcachefs for f_type field in struct statfs in statfs() or fstatfs().
> 
> > > Suggested-by: Su Yue <l@damenly.org>
> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> 
> > I was thinking you'd just rename the STATFS_MAGIC def locally as well,
> > but whatever.. LGTM, thanks for the tweaks!
> 
> Ah, I thought it'd be more readable this way from bcachefs point.
> Kent, just let me know if you prefer Brian's way and I'll send v4.

It's in my tree now :)

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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-08  2:08 ` Glass Su
@ 2024-05-08 21:17   ` Petr Vorel
  2024-05-08 21:27     ` Kent Overstreet
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2024-05-08 21:17 UTC (permalink / raw
  To: Glass Su
  Cc: linux-bcachefs, Kent Overstreet, Su Yue, Brian Foster, Coly Li,
	linux-kernel

HI Su, Kent,

> > On May 7, 2024, at 23:37, Petr Vorel <pvorel@suse.cz> wrote:

> > Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> > BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> > definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.

> > There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> > which use UUID_INIT() and are used only in libbcachefs. Therefore move
> > only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> > libbcachefs for f_type field in struct statfs in statfs() or fstatfs().

> > Suggested-by: Su Yue <l@damenly.org>

> Would you kindly amend it to Su Yue <glass.su@suse.com> or
> Kent can help if the patch is going to be applied.

Unfortunately Kent was faster, it's already merged without your SUSE address
(and your RBT you added in the end):

https://evilpiepirate.org/git/bcachefs.git/commit/?h=for-next&id=ce8f9355f23be9756e499682d0d642a741db6c3a

@Kent: Maybe it can be even now amended (with Su Yue's RBT).

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Changes v2->v3:
> > * Align tab with other entries.
...
> > #include <linux/uuid.h>
> > +#include <uapi/linux/magic.h>
> > #include "vstructs.h"

> > #ifdef __KERNEL__
> > @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
> > UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \
> >  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)

> > -#define BCACHEFS_STATFS_MAGIC 0xca451a4e
> > +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC

> > #define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL)
> > #define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL)
> > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> > index 1b40a968ba91..bb575f3ab45e 100644
> > --- a/include/uapi/linux/magic.h
> > +++ b/include/uapi/linux/magic.h
> > @@ -37,6 +37,7 @@
> > #define HOSTFS_SUPER_MAGIC 0x00c0ffee
> > #define OVERLAYFS_SUPER_MAGIC 0x794c7630
> > #define FUSE_SUPER_MAGIC 0x65735546
> > +#define BCACHEFS_SUPER_MAGIC 0xca451a4e

> IIUC, due to some historical reasons bcachefs used to switched
> ondisk sb magic from BCACHE_MAGIC to BCHFS_MAGIC.
> Other major fses uses  *_SUPER_MAGIC both for ondisk 
> sb magic, kstatfs::f_type and super_block::s_magic.
> However, for bcacehfs there are three magic numbers.

Thanks for info. But for struct statfs in statfs() or fstatfs() only 0xca451a4e
is needed, right? I would not expose the other(s) unless it's really needed.
Also we'd need to backport UUID_INIT() into UAPI :(.

> Anyway, it looks good to me so far:
> Reviewed-by: Su Yue <glass.su@suse.com> 

And also without your RBT.

Kind regards,
Petr

> — 
> Su

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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-08 21:17   ` Petr Vorel
@ 2024-05-08 21:27     ` Kent Overstreet
  2024-05-09  6:17       ` Petr Vorel
  0 siblings, 1 reply; 9+ messages in thread
From: Kent Overstreet @ 2024-05-08 21:27 UTC (permalink / raw
  To: Petr Vorel
  Cc: Glass Su, linux-bcachefs, Su Yue, Brian Foster, Coly Li,
	linux-kernel

On Wed, May 08, 2024 at 11:17:59PM +0200, Petr Vorel wrote:
> HI Su, Kent,
> 
> > > On May 7, 2024, at 23:37, Petr Vorel <pvorel@suse.cz> wrote:
> 
> > > Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> > > BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> > > definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.
> 
> > > There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> > > which use UUID_INIT() and are used only in libbcachefs. Therefore move
> > > only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> > > libbcachefs for f_type field in struct statfs in statfs() or fstatfs().
> 
> > > Suggested-by: Su Yue <l@damenly.org>
> 
> > Would you kindly amend it to Su Yue <glass.su@suse.com> or
> > Kent can help if the patch is going to be applied.
> 
> Unfortunately Kent was faster, it's already merged without your SUSE address
> (and your RBT you added in the end):
> 
> https://evilpiepirate.org/git/bcachefs.git/commit/?h=for-next&id=ce8f9355f23be9756e499682d0d642a741db6c3a
> 
> @Kent: Maybe it can be even now amended (with Su Yue's RBT).

...sure, make me invalidate my test results :)

> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> > > Changes v2->v3:
> > > * Align tab with other entries.
> ...
> > > #include <linux/uuid.h>
> > > +#include <uapi/linux/magic.h>
> > > #include "vstructs.h"
> 
> > > #ifdef __KERNEL__
> > > @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
> > > UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \
> > >  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
> 
> > > -#define BCACHEFS_STATFS_MAGIC 0xca451a4e
> > > +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC
> 
> > > #define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL)
> > > #define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL)
> > > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> > > index 1b40a968ba91..bb575f3ab45e 100644
> > > --- a/include/uapi/linux/magic.h
> > > +++ b/include/uapi/linux/magic.h
> > > @@ -37,6 +37,7 @@
> > > #define HOSTFS_SUPER_MAGIC 0x00c0ffee
> > > #define OVERLAYFS_SUPER_MAGIC 0x794c7630
> > > #define FUSE_SUPER_MAGIC 0x65735546
> > > +#define BCACHEFS_SUPER_MAGIC 0xca451a4e
> 
> > IIUC, due to some historical reasons bcachefs used to switched
> > ondisk sb magic from BCACHE_MAGIC to BCHFS_MAGIC.
> > Other major fses uses  *_SUPER_MAGIC both for ondisk 
> > sb magic, kstatfs::f_type and super_block::s_magic.
> > However, for bcacehfs there are three magic numbers.
> 
> Thanks for info. But for struct statfs in statfs() or fstatfs() only 0xca451a4e
> is needed, right? I would not expose the other(s) unless it's really needed.
> Also we'd need to backport UUID_INIT() into UAPI :(.
> 
> > Anyway, it looks good to me so far:
> > Reviewed-by: Su Yue <glass.su@suse.com> 
> 
> And also without your RBT.
> 
> Kind regards,
> Petr
> 
> > — 
> > Su

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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-08 21:27     ` Kent Overstreet
@ 2024-05-09  6:17       ` Petr Vorel
  2024-05-09  7:01         ` Glass Su
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2024-05-09  6:17 UTC (permalink / raw
  To: Kent Overstreet
  Cc: Glass Su, linux-bcachefs, Su Yue, Brian Foster, Coly Li,
	linux-kernel

Hi Kent,

> On Wed, May 08, 2024 at 11:17:59PM +0200, Petr Vorel wrote:
> > Hi Su, Kent,

> > > > On May 7, 2024, at 23:37, Petr Vorel <pvorel@suse.cz> wrote:

> > > > Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
> > > > BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
> > > > definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.

> > > > There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
> > > > which use UUID_INIT() and are used only in libbcachefs. Therefore move
> > > > only BCACHEFS_STATFS_MAGIC value, which can be used outside of
> > > > libbcachefs for f_type field in struct statfs in statfs() or fstatfs().

> > > > Suggested-by: Su Yue <l@damenly.org>

> > > Would you kindly amend it to Su Yue <glass.su@suse.com> or
> > > Kent can help if the patch is going to be applied.

> > Unfortunately Kent was faster, it's already merged without your SUSE address
> > (and your RBT you added in the end):

> > https://evilpiepirate.org/git/bcachefs.git/commit/?h=for-next&id=ce8f9355f23be9756e499682d0d642a741db6c3a

> > @Kent: Maybe it can be even now amended (with Su Yue's RBT).

> ...sure, make me invalidate my test results :)

Thank you! FYI there was also his RBT (Reviewed-by: Su Yue <glass.su@suse.com>)

https://lore.kernel.org/linux-bcachefs/6D9FCB08-480D-4CA0-82E2-284B1F2BF8FD@suse.com/

Kind regards,
Petr

> > > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > > ---
> > > > Changes v2->v3:
> > > > * Align tab with other entries.
> > ...
> > > > #include <linux/uuid.h>
> > > > +#include <uapi/linux/magic.h>
> > > > #include "vstructs.h"

> > > > #ifdef __KERNEL__
> > > > @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
> > > > UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \
> > > >  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)

> > > > -#define BCACHEFS_STATFS_MAGIC 0xca451a4e
> > > > +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC

> > > > #define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL)
> > > > #define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL)
> > > > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> > > > index 1b40a968ba91..bb575f3ab45e 100644
> > > > --- a/include/uapi/linux/magic.h
> > > > +++ b/include/uapi/linux/magic.h
> > > > @@ -37,6 +37,7 @@
> > > > #define HOSTFS_SUPER_MAGIC 0x00c0ffee
> > > > #define OVERLAYFS_SUPER_MAGIC 0x794c7630
> > > > #define FUSE_SUPER_MAGIC 0x65735546
> > > > +#define BCACHEFS_SUPER_MAGIC 0xca451a4e

> > > IIUC, due to some historical reasons bcachefs used to switched
> > > ondisk sb magic from BCACHE_MAGIC to BCHFS_MAGIC.
> > > Other major fses uses  *_SUPER_MAGIC both for ondisk 
> > > sb magic, kstatfs::f_type and super_block::s_magic.
> > > However, for bcacehfs there are three magic numbers.

> > Thanks for info. But for struct statfs in statfs() or fstatfs() only 0xca451a4e
> > is needed, right? I would not expose the other(s) unless it's really needed.
> > Also we'd need to backport UUID_INIT() into UAPI :(.

> > > Anyway, it looks good to me so far:
> > > Reviewed-by: Su Yue <glass.su@suse.com> 

> > And also without your RBT.

> > Kind regards,
> > Petr

> > > — 
> > > Su

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

* Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
  2024-05-09  6:17       ` Petr Vorel
@ 2024-05-09  7:01         ` Glass Su
  0 siblings, 0 replies; 9+ messages in thread
From: Glass Su @ 2024-05-09  7:01 UTC (permalink / raw
  To: Petr Vorel
  Cc: Kent Overstreet, linux-bcachefs, Su Yue, Brian Foster, Coly Li,
	linux-kernel



> On May 9, 2024, at 14:17, Petr Vorel <pvorel@suse.cz> wrote:
> 
> Hi Kent,
> 
>> On Wed, May 08, 2024 at 11:17:59PM +0200, Petr Vorel wrote:
>>> Hi Su, Kent,
> 
>>>>> On May 7, 2024, at 23:37, Petr Vorel <pvorel@suse.cz> wrote:
> 
>>>>> Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
>>>>> BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
>>>>> definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.
> 
>>>>> There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
>>>>> which use UUID_INIT() and are used only in libbcachefs. Therefore move
>>>>> only BCACHEFS_STATFS_MAGIC value, which can be used outside of
>>>>> libbcachefs for f_type field in struct statfs in statfs() or fstatfs().
> 
>>>>> Suggested-by: Su Yue <l@damenly.org>
> 
>>>> Would you kindly amend it to Su Yue <glass.su@suse.com> or
>>>> Kent can help if the patch is going to be applied.
> 
>>> Unfortunately Kent was faster, it's already merged without your SUSE address
>>> (and your RBT you added in the end):
> 
>>> https://evilpiepirate.org/git/bcachefs.git/commit/?h=for-next&id=ce8f9355f23be9756e499682d0d642a741db6c3a
> 
>>> @Kent: Maybe it can be even now amended (with Su Yue's RBT).
> 
>> ...sure, make me invalidate my test results :)
> 
> Thank you! FYI there was also his RBT (Reviewed-by: Su Yue <glass.su@suse.com>)
> 
Thanks both for you Petr and Kent :- )  Sorry for inconvenience due to my email quirk...

— 
Su
> https://lore.kernel.org/linux-bcachefs/6D9FCB08-480D-4CA0-82E2-284B1F2BF8FD@suse.com/
> 
> Kind regards,
> Petr
> 
>>>>> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>>>>> ---
>>>>> Changes v2->v3:
>>>>> * Align tab with other entries.
>>> ...
>>>>> #include <linux/uuid.h>
>>>>> +#include <uapi/linux/magic.h>
>>>>> #include "vstructs.h"
> 
>>>>> #ifdef __KERNEL__
>>>>> @@ -1275,7 +1276,7 @@ enum bch_compression_opts {
>>>>> UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \
>>>>> 0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
> 
>>>>> -#define BCACHEFS_STATFS_MAGIC 0xca451a4e
>>>>> +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC
> 
>>>>> #define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL)
>>>>> #define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL)
>>>>> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
>>>>> index 1b40a968ba91..bb575f3ab45e 100644
>>>>> --- a/include/uapi/linux/magic.h
>>>>> +++ b/include/uapi/linux/magic.h
>>>>> @@ -37,6 +37,7 @@
>>>>> #define HOSTFS_SUPER_MAGIC 0x00c0ffee
>>>>> #define OVERLAYFS_SUPER_MAGIC 0x794c7630
>>>>> #define FUSE_SUPER_MAGIC 0x65735546
>>>>> +#define BCACHEFS_SUPER_MAGIC 0xca451a4e
> 
>>>> IIUC, due to some historical reasons bcachefs used to switched
>>>> ondisk sb magic from BCACHE_MAGIC to BCHFS_MAGIC.
>>>> Other major fses uses  *_SUPER_MAGIC both for ondisk 
>>>> sb magic, kstatfs::f_type and super_block::s_magic.
>>>> However, for bcacehfs there are three magic numbers.
> 
>>> Thanks for info. But for struct statfs in statfs() or fstatfs() only 0xca451a4e
>>> is needed, right? I would not expose the other(s) unless it's really needed.
>>> Also we'd need to backport UUID_INIT() into UAPI :(.
> 
>>>> Anyway, it looks good to me so far:
>>>> Reviewed-by: Su Yue <glass.su@suse.com> 
> 
>>> And also without your RBT.
> 
>>> Kind regards,
>>> Petr
> 
>>>> — 
>>>> Su



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

end of thread, other threads:[~2024-05-09  7:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 15:37 [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h Petr Vorel
2024-05-07 16:01 ` Brian Foster
2024-05-07 16:44   ` Petr Vorel
2024-05-08  2:27     ` Kent Overstreet
2024-05-08  2:08 ` Glass Su
2024-05-08 21:17   ` Petr Vorel
2024-05-08 21:27     ` Kent Overstreet
2024-05-09  6:17       ` Petr Vorel
2024-05-09  7:01         ` Glass Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).