Skip to contentSkip to conversation

logfs: clarify MTD dependency

PATCH In review Arnd Bergmann 3 participants 4 messages Jan 13, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 logfs: clarify MTD dependency

After a change to the way that composite modules work, we get a logfs build error:

fs/built-in.o: In function `logfs_mount':
:(.text+0x139d34): undefined reference to logfs_get_sb_mtd' fs/built-in.o: In function logfs_get_sb_bdev':
:(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of logfs in a way that we can no longer configure logfs as built-in when the MTD core is a loadable module, while leaving the dependency to require at least one of MTD or BLOCK to be enabled.

Another patch tried to work around the problem, but accidentally dropped the dependency on 'BLOCK || MTD', allowing the file system to be built if neither is selected.

Fixes cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Fixes e6be296f680c ("logfs: fix logfs build errors and dependencies")

---
I originally sent the patch November 27, but the discussion did not conclude, see https://lkml.org/lkml/2015/11/27/299

This version is rebased on the patch that got applied yesterday.

fs/logfs/Kconfig +1 -2
index 2b1485a5c086..2b4503163930 100644
@@ -1,7 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on BLOCK || BLOCK=n
-	depends on MTD || MTD=n
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32
#1 lore raw
Quoted 14 lines · On Wed, 13 Jan 2016 14:25:55 +0100 Arnd Bergmann <[email protected]> wrote:

After a change to the way that composite modules work, we get a logfs build error:

fs/built-in.o: In function `logfs_mount':
:(.text+0x139d34): undefined reference to logfs_get_sb_mtd' fs/built-in.o: In function logfs_get_sb_bdev':
:(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of logfs in a way that we can no longer configure logfs as built-in when the MTD core is a loadable module, while leaving the dependency to require at least one of MTD or BLOCK to be enabled.

Quoted 7 lines

Another patch tried to work around the problem, but accidentally dropped the dependency on 'BLOCK || MTD', allowing the file system to be built if neither is selected.

Fixes cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Fixes e6be296f680c ("logfs: fix logfs build errors and dependencies")

Randy's "logfs: fix logfs build errors and dependencies" is an only-in-mm thing. So it would make sense to combine the two patches into a single one and to give that an appropriate changelog.

How does this look? (Primary author was chosen randomly)

From: Arnd Bergmann <[email protected]>
Subject: logfs: fix logfs build errors and dependencies

Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:

fs/built-in.o: In function `logfs_mount':
super.c:(.text+0x92a6f): undefined reference to logfs_get_sb_mtd' fs/built-in.o: In function logfs_get_sb_bdev':
(.text+0x93530): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of logfs in a way that we can no longer configure logfs as built-in when the MTD core is a loadable module, while leaving the dependency to require at least one of MTD or BLOCK to be enabled.

Cc Michal Marek <[email protected]>
Cc Peter Chen <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Joern Engel <[email protected]>
Cc Prasad Joshi <[email protected]>

---

 fs/logfs/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/logfs/Kconfig renamed from fs/logfs/Kconfig~logfs-fix-logfs-build-errors-and-dependencies +1 -1
diff -puN fs/logfs/Kconfig~logfs-fix-logfs-build-errors-and-dependencies fs/logfs/Kconfig
@@ -1,6 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on (MTD || BLOCK)
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32

_

#2 lore raw
Quoted 24 lines · On Wednesday 13 January 2016 12:39:18 Andrew Morton wrote:

Randy's "logfs: fix logfs build errors and dependencies" is an only-in-mm thing. So it would make sense to combine the two patches into a single one and to give that an appropriate changelog.

How does this look? (Primary author was chosen randomly)

From: Arnd Bergmann <[email protected]>
Subject: logfs: fix logfs build errors and dependencies

Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:

fs/built-in.o: In function `logfs_mount':
super.c:(.text+0x92a6f): undefined reference to logfs_get_sb_mtd' fs/built-in.o: In function logfs_get_sb_bdev':
(.text+0x93530): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of logfs in a way that we can no longer configure logfs as built-in when the MTD core is a loadable module, while leaving the dependency to require at least one of MTD or BLOCK to be enabled.

Quoted 9 lines
Cc Michal Marek <[email protected]>
Cc Peter Chen <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Joern Engel <[email protected]>
Cc Prasad Joshi <[email protected]>

Looks good, thanks!

Arnd

#3 lore raw
Quoted 35 lines · Arnd Bergmann
Quoted 24 lines · On Wednesday 13 January 2016 12:39:18 Andrew Morton wrote:

Randy's "logfs: fix logfs build errors and dependencies" is an only-in-mm thing. So it would make sense to combine the two patches into a single one and to give that an appropriate changelog.

How does this look? (Primary author was chosen randomly)

From: Arnd Bergmann <[email protected]>
Subject: logfs: fix logfs build errors and dependencies

Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:

fs/built-in.o: In function `logfs_mount':
super.c:(.text+0x92a6f): undefined reference to logfs_get_sb_mtd' fs/built-in.o: In function logfs_get_sb_bdev':
(.text+0x93530): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of logfs in a way that we can no longer configure logfs as built-in when the MTD core is a loadable module, while leaving the dependency to require at least one of MTD or BLOCK to be enabled.

Quoted 9 lines
Cc Michal Marek <[email protected]>
Cc Peter Chen <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Joern Engel <[email protected]>
Cc Prasad Joshi <[email protected]>
Quoted 4 lines

Looks good, thanks!

Arnd

Thanks also.

Signature · 1 line
~Randy