Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 148381 - Submount in 2.6.18 kernel
Summary: Submount in 2.6.18 kernel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
: 150906 (view as bug list)
Depends on:
Blocks: 148429
  Show dependency tree
 
Reported: 2006-09-20 08:03 UTC by Phillip Berndt
Modified: 2006-12-02 07:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch against submount-0.9 with submount-0.9-sem2mutex.patch applied (submount-0.9-kernel2.6.18.patch,2.02 KB, patch)
2006-09-21 00:59 UTC, Phillip Berndt
Details | Diff
patch (2618.patch,4.49 KB, patch)
2006-10-04 08:15 UTC, Daniel Drake (RETIRED)
Details | Diff
updated patch (new.patch,4.48 KB, patch)
2006-10-10 18:47 UTC, Daniel Drake (RETIRED)
Details | Diff
Patch for 2.6.19 (submount-0.9-kernel2.6.19.patch,384 bytes, patch)
2006-12-02 03:03 UTC, Phillip Berndt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Phillip Berndt 2006-09-20 08:03:51 UTC
/linux/include/linux/fs.h defines get_sb_nodev as:

extern int get_sb_nodev(struct file_system_type *fs_type,
        int flags, void *data,
        int (*fill_super)(struct super_block *, void *, int),
        struct vfsmount *mnt);

While subfs.c calls:

newmount->sb = get_sb_nodev(fst, flags, data, subfs_fill_super);


I don't know much about kernel symbols so I don't know how to correct that, so I can't attach a patch. Sorry for that.
Comment 1 Phillip Berndt 2006-09-21 00:59:31 UTC
Created attachment 97609 [details, diff]
Patch against submount-0.9 with submount-0.9-sem2mutex.patch applied

After a short while of trial-and-error and reading through the kernel's vfs  documentation I have finally been able to write a patch on my own: subfs_get_super now returns an integer and takes a vfsmount structure as it's last argument. Instead of calling get_sb_nodev I call sget directly (which is not quite nice, because my solution bypasses the default vfs functions. But it works and should keep working until a new version of submount arrives).

The patch is for submount-0.9 with the submount-0.9-sem2mutex.patch patch already applied.

I don't know the reaction of <2.6.18 kernels against the patch, so this NEEDS FURTHER TESTING (or a neater patch with version detection. I've been too lazy to write that.)
Comment 2 Daniel Drake (RETIRED) gentoo-dev 2006-10-04 08:15:33 UTC
Created attachment 98779 [details, diff]
patch

I think you are on the right lines but it can be done in a less intrusive way (we won't be seeing a new submount release any time soon...)

Also there were a couple of other issues that needed addressing. Please test this patch.
Comment 3 Filip Brcic 2006-10-05 17:28:57 UTC
(In reply to comment #2)
> Created an attachment (id=98779) [edit]
> patch
> 
> I think you are on the right lines but it can be done in a less intrusive way
> (we won't be seeing a new submount release any time soon...)
> 
> Also there were a couple of other issues that needed addressing. Please test
> this patch.

Works for me. Thanx.

I wanted to make a patch myself, but it crossed my mind that somebody else might have made a patch already :)

I tested this with suspend2-2.6.18 kernel on Amd64. I can attach the ebuild here if needed. Just reply here, I'll be watching this bug.
Comment 4 tsattler 2006-10-05 23:29:18 UTC
I'm using ck-sources. The first patch is working fine. The second
caused a kernel Oops. I added the patch at the end of src_unpack:

# Fix compile on 2.6.18, bug #148381
if kernel_is ge 2 6 18; then
  epatch ${FILESDIR}/${P}-kernel2.6.18.patch
fi
Comment 5 Phillip Berndt 2006-10-06 02:03:12 UTC
Does not work for me:

subfs 0.9
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000148
 printing eip:
e198e873
*pde = 00000000
Oops: 0002 [#1]
PREEMPT
Modules linked in: subfs vfat fat tun xt_multiport iptable_mangle snd_seq snd_seq_device snd_intel8x0m snd_intel8x0 snd_ac97_codec snd_ac97_bus fuse ehci_hcd uhci_hcd
radeon drm intel_agp agpgart snd_pcm_oss snd_pcm snd_timer snd_page_alloc snd_mixer_oss snd soundcore joydev
CPU:    0
EIP:    0060:[<e198e873>]    Not tainted VLI
EFLAGS: 00010246   (2.6.18 #1)
EIP is at subfs_get_super+0xd2/0x10a [subfs]
eax: 00000000   ebx: c3b44c00   ecx: c3b44c00   edx: 00000000
esi: c3b44c00   edi: dc436000   ebp: dc436000   esp: d3365e80
ds: 007b   es: 007b   ss: 0068
Process mount (pid: 19944, ti=d3364000 task=c1582550 task.ti=d3364000)
Stack: c0168aae 0000000b 000000d0 c14748c0 fffffff4 e198f340 c2abc000 c01572c7
       e198f340 00000001 c2abc000 dc436000 c14748c0 d0675000 e198f340 d0675005
       c2abc000 c0157321 e198f340 00000001 c2abc000 dc436000 d0675000 dc436000
Call Trace:
 [<c0168aae>] alloc_vfsmnt+0x9e/0xc7
 [<c01572c7>] vfs_kern_mount+0x35/0x66
 [<c0157321>] do_kern_mount+0x29/0x39
 [<c0169db5>] do_new_mount+0x67/0xa4
 [<c016a3f5>] do_mount+0x153/0x16b
 [<c016a257>] copy_mount_options+0x49/0x94
 [<c016a69b>] sys_mount+0x79/0xb3
 [<c0102bd1>] sysenter_past_esp+0x56/0x79
Code: 89 c7 5a 85 ff 59 89 43 0c b8 f4 ff ff ff 74 4b be 98 ea 98 e1 ac aa 84 c0 75 fa 55 53 e8 e1 fc ff ff 5e 85 c0 5f 75 33 8b 43 14 <89> 98 48 01 00 00 ff 74 24 30
68 ee e4 98 e1 55 ff 74 24 30 ff
EIP: [<e198e873>] subfs_get_super+0xd2/0x10a [subfs] SS:ESP 0068:d3365e80
Comment 6 Daniel Drake (RETIRED) gentoo-dev 2006-10-09 19:59:28 UTC
Thanks, I see the silly mistake, I'll get back to this soonish...
Comment 7 Daniel Drake (RETIRED) gentoo-dev 2006-10-10 18:47:37 UTC
Created attachment 99334 [details, diff]
updated patch

Please try this one. It would be great if someone could test it against both 2.6.17 and 2.6.18 (should work in both cases!)
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2006-10-11 09:41:27 UTC
*** Bug 150906 has been marked as a duplicate of this bug. ***
Comment 9 Phillip Berndt 2006-10-11 13:32:42 UTC
subfs 0.9
[...]

The patch works for me in 2.6.18.
Comment 10 Daniel Drake (RETIRED) gentoo-dev 2006-10-11 14:34:08 UTC
Thanks. Pretty please can someone test it agains 2.6.17 as well? :)
Comment 11 Simonas Leleiva 2006-10-14 06:01:56 UTC
Works fine with 2.6.17-r4. Thanks!

Waiting this patch to portage ASAP ;)
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2006-10-14 06:57:37 UTC
Thanks, in portage
Comment 13 Daniel Drake (RETIRED) gentoo-dev 2006-10-14 07:59:07 UTC
Just an advance warning: Unless a proper maintainer steps up I'm probably going to package.mask and kill submount next time it fails to compile against a new kernel. It's simply too much hassle for me to go around fixing so many external kernel modules.

Suitable replacements for this package include the in-kernel automounter, hal, ivman.
Comment 14 Daniel Drake (RETIRED) gentoo-dev 2006-12-01 17:34:29 UTC
Surprise surprise, it's broken for 2.6.19. I am going to send a mail to gentoo-dev seeking new maintainers, if nobody steps up it will be removed from portage in approx 4 weeks.
Comment 15 Phillip Berndt 2006-12-02 03:03:39 UTC
Created attachment 103183 [details, diff]
Patch for 2.6.19

Afaik i_blksize has been removed from the kernel (it says so in a lkml thread [1]).
This patch removes the code to set i_blksize and makes submount work for me again.

Ps. Is there a document on the duties and responsibilities of a package maintainer?

[1] http://lkml.org/lkml/2006/7/2/164
Comment 16 Daniel Drake (RETIRED) gentoo-dev 2006-12-02 07:39:58 UTC
It would involve becoming a Gentoo developer, see http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml