Skip to contentSkip to conversation

erofs-utils: fix multiple definition of `sbi'

PATCH In review Gao Xiang via Linux-erofs 3 participants 4 messages Dec 8, 2020 – Dec 12, 2020 1 message not in the archive Library code

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 erofs-utils: fix multiple definition of `sbi'

As nl6720 reported [1], lib/inode.o (mkfs) and lib/super.o (erofsfuse) could be compiled together by some options. Fix it now.

[1] https://lore.kernel.org/r/10789285.Na0ui7I3VY@walnut

---
Hi nl6720,
could you verify this patch? Thanks in advance!

Thanks,
Gao Xiang

 lib/config.c | 1 +
 lib/inode.c  | 2 --
 lib/super.c  | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)
lib/config.c +1 -0
index 315511284871..3ecd48140cfd 100644
@@ -11,6 +11,7 @@
 #include "erofs/internal.h"
 
 struct erofs_configure cfg;
+struct erofs_sb_info sbi;
 
 void erofs_init_configure(void)
 {
lib/inode.c +0 -2
index 3d634fc92852..0c4839dc7152 100644
@@ -22,8 +22,6 @@
 #include "erofs/xattr.h"
 #include "erofs/exclude.h"
 
-struct erofs_sb_info sbi;
-
 #define S_SHIFT                 12
 static unsigned char erofs_ftype_by_mode[S_IFMT >> S_SHIFT] = {
 	[S_IFREG >> S_SHIFT]  = EROFS_FT_REG_FILE,
lib/super.c +0 -2
index 2d366928e12b..025cefee3aac 100644
@@ -11,8 +11,6 @@
 #include "erofs/io.h"
 #include "erofs/print.h"
 
-struct erofs_sb_info sbi;
-
 static bool check_layout_compatibility(struct erofs_sb_info *sbi,
 				       struct erofs_super_block *dsb)
 {
Signature · 1 line
2.24.0
#2 lore raw
Quoted 4 lines · On Tuesday, 8 December 2020 12:57:41 EET Gao Xiang wrote:

As nl6720 reported [1], lib/inode.o (mkfs) and lib/super.o (erofsfuse) could be compiled together by some options. Fix it now.

[1] https://lore.kernel.org/r/10789285.Na0ui7I3VY@walnut

Quoted 8 lines

---
Hi nl6720,
could you verify this patch? Thanks in advance!

Thanks,
Gao Xiang

This patch fixes the build issue for me. Thanks!

#3 lore raw
Quoted 11 lines · On Tue, Dec 08, 2020 at 06:16:57PM +0200, nl6720 wrote:
Quoted 10 lines · On Tuesday, 8 December 2020 12:57:41 EET Gao Xiang wrote:

As nl6720 reported [1], lib/inode.o (mkfs) and lib/super.o (erofsfuse) could be compiled together by some options. Fix it now.

[1] https://lore.kernel.org/r/10789285.Na0ui7I3VY@walnut

---
Hi nl6720,
could you verify this patch? Thanks in advance!

Quoted 4 lines
Quoted 2 lines

Thanks,
Gao Xiang

This patch fixes the build issue for me. Thanks!

Thanks for verification, I'll push out this later...

Fixes 5e35b75ad499 ("erofs-utils: introduce fuse implementation")

Thanks,
Gao Xiang

Quoted 3 lines
author Reviewed-by Li Guifu
#4 lore raw
Quoted 9 lines · Gao Xiang
Quoted 8 lines · On Tue, Dec 08, 2020 at 06:16:57PM +0200, nl6720 wrote:
Quoted 7 lines · On Tuesday, 8 December 2020 12:57:41 EET Gao Xiang wrote:

As nl6720 reported [1], lib/inode.o (mkfs) and lib/super.o (erofsfuse) could be compiled together by some options. Fix it now.

[1] https://lore.kernel.org/r/10789285.Na0ui7I3VY@walnut

---

It looks good

Thanks,