On Tuesday 14 October 2003 18:58, Svetoslav Slavtchev wrote: > is this normal ? > > WARNING: Module > /lib/modules/2.6.0test7.bk6.1mdksmp/kernel/drivers/md/dm-snapshot.ko > ignored, due to loop WARNING: Loop detected: > /home/svetljo/rpm/BUILD/kernel-ruby2.6/temp-root/lib/modules/2.6.0test7.bk6 >.1mdksmp/kernel/drivers/md/dm-exception-store.ko needs dm-snapshot.ko which > needs dm-exception-store.ko again! > WARNING: Module > /lib/modules/2.6.0test7.bk6.1mdksmp/kernel/drivers/md/dm-exception-store.ko > ignored, due to loop A patch like this one should fix these warnings. --- a/drivers/md/Makefile 14 Oct 2003 15:10:08 -0000 +++ b/drivers/md/Makefile 15 Oct 2003 13:34:24 -0000 @@ -7,6 +7,8 @@ dm-mirror-objs := dm-log.o dm-raid1.o +dm-snap-objs := dm-snapshot.o dm-exception-store.o + # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise # themselves, and md.o may use the personalities when it @@ -19,7 +21,7 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_BLK_DEV_MD) += md.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o -obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o dm-exception-store.o +obj-$(CONFIG_DM_SNAPSHOT) += dm-snap.o obj-$(CONFIG_DM_MIRROR) += dm-mirror.o obj-$(CONFIG_BLK_DM_CRYPT) += dm-crypt.o obj-$(CONFIG_BLK_DEV_DM_BBR) += dm-bbr.o However, this isn't completely correct. DM can do its own module auto-loading, but it requires that the name of the kernel-module be the same as the name of the DM target. In this case, the target is named "snapshot", so the kernel module must be called "dm-snapshot". So that would lead you to think the following patch would be better: --- a/drivers/md/Makefile 14 Oct 2003 15:10:08 -0000 +++ b/drivers/md/Makefile 15 Oct 2003 13:37:19 -0000 @@ -7,6 +7,8 @@ dm-mirror-objs := dm-log.o dm-raid1.o +dm-snapshot-objs := dm-snapshot.o dm-exception-store.o + # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise # themselves, and md.o may use the personalities when it @@ -19,7 +21,7 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_BLK_DEV_MD) += md.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o -obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o dm-exception-store.o +obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o obj-$(CONFIG_DM_MIRROR) += dm-mirror.o obj-$(CONFIG_BLK_DM_CRYPT) += dm-crypt.o obj-$(CONFIG_BLK_DEV_DM_BBR) += dm-bbr.o But this creates another type of circular dependency, which is worse than the one you reported. So, it would seem that if we want to allow snapshot to be built as a separate kernel module, the file dm-snapshot.c has to be renamed to something else (maybe dm-snap.c). Then the Makefile patch becomes: --- a/drivers/md/Makefile 14 Oct 2003 15:10:08 -0000 +++ b/drivers/md/Makefile 15 Oct 2003 13:43:43 -0000 @@ -7,6 +7,8 @@ dm-mirror-objs := dm-log.o dm-raid1.o +dm-snapshot-objs := dm-snap.o dm-exception-store.o + # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise # themselves, and md.o may use the personalities when it @@ -19,7 +21,7 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_BLK_DEV_MD) += md.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o -obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o dm-exception-store.o +obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o obj-$(CONFIG_DM_MIRROR) += dm-mirror.o obj-$(CONFIG_BLK_DM_CRYPT) += dm-crypt.o obj-$(CONFIG_BLK_DEV_DM_BBR) += dm-bbr.o Or, we could take the approach that the 2.4 version of DM does, and don't build snapshot as a separate module. In this case, none of the above patches (nor the patch I submitted yesterday) are necessary, but we'll need some minor code changes in dm.c and dm.h. Joe, what's your opinion? -- Kevin Corry kevcorry@xxxxxxxxxx http://evms.sourceforge.net/