Skip to contentSkip to conversation

romfs: only select BUFFER_HEAD for the block based path

PATCH In review Christoph Hellwig 4 participants 4 messages Aug 4, 2023 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 romfs: only select BUFFER_HEAD for the block based path

selecting BUFFER_HEAD unconditionally does not work as romfs can also be built with only the MTD backend and thus without CONFIG_BLOCK.

Fixes 0f842210d97a ("fs/Kconfig: Fix compile error for romfs")
---
 fs/romfs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/romfs/Kconfig +1 -1
index 3f6b550eee6192..f24a96a331af1b 100644
@@ -2,7 +2,6 @@
 config ROMFS_FS
 	tristate "ROM file system support"
 	depends on BLOCK || MTD
-	select BUFFER_HEAD
 	help
 	  This is a very small read-only file system mainly intended for
 	  initial ram disks of installation disks, but it could be used for
@@ -58,6 +57,7 @@ endchoice
 config ROMFS_ON_BLOCK
 	bool
 	default y if ROMFS_BACKED_BY_BLOCK || ROMFS_BACKED_BY_BOTH
+	select BUFFER_HEAD
 
 config ROMFS_ON_MTD
 	bool
Signature · 1 line
2.39.2
#1 lore raw

Sorry, this should be:

From: Christoph Hellwig <[email protected]>

to match the signoff. I managed to mess my mail setup, but it should be fixed now.

Quoted 31 lines · Christoph Hellwig

selecting BUFFER_HEAD unconditionally does not work as romfs can also be built with only the MTD backend and thus without CONFIG_BLOCK.

Fixes 0f842210d97a ("fs/Kconfig: Fix compile error for romfs")
---
 fs/romfs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/romfs/Kconfig +1 -1
index 3f6b550eee6192..f24a96a331af1b 100644
@@ -2,7 +2,6 @@
 config ROMFS_FS
 	tristate "ROM file system support"
 	depends on BLOCK || MTD
-	select BUFFER_HEAD
 	help
 	  This is a very small read-only file system mainly intended for
 	  initial ram disks of installation disks, but it could be used for
@@ -58,6 +57,7 @@ endchoice
 config ROMFS_ON_BLOCK
 	bool
 	default y if ROMFS_BACKED_BY_BLOCK || ROMFS_BACKED_BY_BOTH
+	select BUFFER_HEAD
 
 config ROMFS_ON_MTD
 	bool
Signature · 1 line
2.39.2

---end quoted text---

Tested-by on v1 1/1
#2 lore raw
In reply to Christoph Hellwig

Hi Christoph,

Quoted 22 lines · Christoph Hellwig

selecting BUFFER_HEAD unconditionally does not work as romfs can also be built with only the MTD backend and thus without CONFIG_BLOCK.

Fixes 0f842210d97a ("fs/Kconfig: Fix compile error for romfs")
---
  fs/romfs/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/romfs/Kconfig +0 -1
index 3f6b550eee6192..f24a96a331af1b 100644
@@ -2,7 +2,6 @@
  config ROMFS_FS
  	tristate "ROM file system support"
  	depends on BLOCK || MTD
-	select BUFFER_HEAD
  	help
  	  This is a very small read-only file system mainly intended for
  	  initial ram disks of installation disks, but it could be used for

fs/romfs/Kconfig endchoice · line 63

Quoted 7 lines
fs/romfs/Kconfig +1 -0
@@ -58,6 +57,7 @@ endchoice
  config ROMFS_ON_BLOCK
  	bool
  	default y if ROMFS_BACKED_BY_BLOCK || ROMFS_BACKED_BY_BOTH
+	select BUFFER_HEAD
 
  config ROMFS_ON_MTD
  	bool

I have tested the patch on my environment and it resolves the two compile errors reported by kernel test robot. The links are as follows:

Link1: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Link2: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Thanks,
Li Zetao

maintainer
#3 lore raw
In reply to Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

selecting BUFFER_HEAD unconditionally does not work as romfs can also be built with only the MTD backend and thus without CONFIG_BLOCK.

I folded this in with the other one and made a note about that.

Signature · 1 line
Jens Axboe