Hi Jim, On Thu, 2014-01-30 at 10:32 -0700, Jim Davis wrote: > On Wed, Dec 18, 2013 at 5:00 PM, Nicholas A. Bellinger > <nab@xxxxxxxxxxxxxxx> wrote: > > Hi Jim, > > > > On Wed, 2013-12-18 at 06:45 -0700, Jim Davis wrote: > >> Building with the attached random configuration file, > >> > >> LD init/built-in.o > >> drivers/built-in.o: In function `core_alua_state_lba_dependent': > >> /home/jim/linux/drivers/target/target_core_alua.c:492: undefined > >> reference to `__umoddi3' > >> make: *** [vmlinux] Error 1 > > > > Thanks for the heads up. A patch for this has been merged into the > > original, and will be appearing in today's (12192013) linux-next tree. > > I'm continuing to see this (and a similar error) in next- for some > days now; today for instance > > buildlog-1391099072.txt-drivers/built-in.o: In function `target_alua_state_check': > buildlog-1391099072.txt-(.text+0x928d93): undefined reference to `__umoddi3' > buildlog-1391099072.txt:make: *** [vmlinux] Error 1 > -- > buildlog-1391101753.txt- CC init/version.o > buildlog-1391101753.txt- LD init/built-in.o > buildlog-1391101753.txt-drivers/built-in.o: In function `core_alua_state_lba_dependent': > buildlog-1391101753.txt-/home/jim/linux/drivers/target/target_core_alua.c:503: undefined reference to `__umoddi3' > buildlog-1391101753.txt:make: *** [vmlinux] Error 1 > > jim@krebstar:~$ (cd linux; git describe) > next-20140130 Mmm, I assume this is compiled on 32-bit without CONFIG_LBDAF=y, yes..? The sector_div() macro expands to the following in include/linux/kernel.h: #ifdef CONFIG_LBDAF # include <asm/div64.h> # define sector_div(a, b) do_div(a, b) #else # define sector_div(n, b)( \ { \ int _res; \ _res = (n) % (b); \ (n) /= (b); \ _res; \ } \ ) #endif Your likely hitting the latter case, which AFAICT is bogus to use on 32-bit without CONFIG_LBDAF=y set.. Not sure why other uses of sector_div() aren't having the same problem on your config..!? Regardless, this should be using do_div() instead. Care to build test the following patch..? Thanks, --nab diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index 12da9b3..c3d9df6 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -500,7 +500,7 @@ static inline int core_alua_state_lba_dependent( if (segment_mult) { u64 tmp = lba; - start_lba = sector_div(tmp, segment_size * segment_mult); + start_lba = do_div(tmp, segment_size * segment_mult); last_lba = first_lba + segment_size - 1; if (start_lba >= first_lba && -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html