Am 03.10.2013 02:33, schrieb sf...@users.sourceforge.net:
> Florian Klink:
>> When compiling a kernel with BLK_DEV_LOOP=m and AUFS_FS=y, I see at bootup:
>>
>> aufs au_loopback_init:136:swapper/0[1]: loop_backing_file() is not defined
> 
> Ok, I see your point.
> Aufs will be unusable on such system.
> How do you think about moving "symbol_request(loop_backing_file)" from
> au_loopback_init() to au_test_loopback_overlap(), and no changes about
> Kconfig?
> It will postpone the symbol resolution and loading loop module until a
> user adds a loopback-mounted branch to aufs.
> Since I am afraid that disabling AUFS_BDEV_LOOP while BLK_DEV_LOOP=m
> will make users confused very much, I don't think it a good idea to
> change Kconfig as your patch.
> 
> 
> Thanx
> J. R. Okajima



I'm also happy with this "runtime loading" approach :-)

I compiled patched kernel with AUFS_FS=y and BLK_DEV_LOOP=m, and the
dmesg error does not appear at boot time.

But it seems to still load "loop" module as soon as I mount any branch
with aufs.

To test, I tried to mount two branches together, that are not on a
loopback filesystem. The mount succeeded, but "loop" module was
loaded, even though there was no loopback-mounted branch involved
(loopback filesystems are filesystems in a "file", not device, mounted
with mount -o loop, right ? So normal file system normally shouldn't...).

I'm not really into kernel code, but think this happens because
test_overlap() from branch.c always calls au_test_loopback_overlap()
when you add any branch, not only a when adding a "loopback branch".
I there should be some check if it's really a loop branch, before
loading everything (if that is possible).

I tested again on a kernel with the same configuration, but without loop
module file existing in /lib/modules/... (to simulate for example an
initramfs that just wants to make a ro filesystem read-write by a tmpfs
or similar and therefore has no loop module inside). I got the following
error:

# mount -t aufs none root -o br=cow=rw:../../images/arch-base=ro
mount: wrong fs type, bad option, bad superblock on none,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

# dmesg
[   69.996741] aufs au_test_loopback_overlap:39:mount[1519]:
loop_backing_file() is not defined
[   69.996746] aufs test_add:279:mount[1519]: ../../images/arch-base is
overlapped

# cat /proc/mounts

rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
dev /dev devtmpfs
rw,nosuid,relatime,size=1964680k,nr_inodes=491170,mode=755 0 0
run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
/dev/mapper/root / ext4 rw,relatime,discard,data=ordered 0 0
securityfs /sys/kernel/security securityfs
rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts
rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup
rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
efivarfs /sys/firmware/efi/efivars efivarfs
rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/cpuset cgroup
rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup
rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
cgroup /sys/fs/cgroup/memory cgroup
rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup
rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup
rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls cgroup
rw,nosuid,nodev,noexec,relatime,net_cls 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/bfqio cgroup rw,nosuid,nodev,noexec,relatime,bfqio 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs
rw,relatime,fd=35,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
tmpfs /tmp tmpfs rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
/dev/sda2 /boot ext2 rw,relatime 0 0
/dev/sda1 /boot/efi vfat
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse
rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0


So in my opinion, if it should be made possible to compile aufs with
loop as a run-time-dependency, it should still work when it's not able
to access the dependency.

Florian



> 
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
> 


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk

Reply via email to