When returning invalid to dentry operation revalidate segmentatio ns happen...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I'm playing around with the linux virtual file system, but I seem to make
the system unstable ;(

I have the following  dentry_operations table:

    static struct dentry_operations etfs_dentry_operations = {
        d_revalidate: etfs_revalidate,
    };

The revalidate function looks like this:

    static int etfs_revalidate(struct dentry * dentry, int flags)
    {
        printk(KERN_WARNING "ETFS: etfs_revalidate()\n");
        return(0);
    }

This is not a real live function, but I just wanted to see what was causing
the issue.
And it seem to be related to letting the kernel know that the dentry is no
longer valid.

So what do I do:

	[root@Tommy obj]# /sbin/insmod etfs.o 
	[root@Tommy obj]# mount none /etfs -t etfs
	[root@Tommy obj]# ls /etfs/test            <--- test is a virtual
file
	/etfs/test
	[root@Tommy obj]# ls /etfs/test
	/etfs/test
	[root@Tommy obj]# ls /etfs/test
	Segmentation fault

Some times it fails the second revalidate function, but above it failed the
third time.
This is what is in the log. The "ETFS" message are corresponding to the vfs
defined calls:

    Nov 30 11:54:33 Tommy kernel: ETFS: init_etfs()
    Nov 30 11:54:40 Tommy kernel: ETFS: etfs_read_super()
    Nov 30 11:54:40 Tommy kernel: ETFS: etfs_add_new_file(, 2)
    Nov 30 11:54:40 Tommy kernel: ETFS: etfs_add_new_file(, 3)
    Nov 30 11:54:48 Tommy kernel: ETFS: etfs_root_lookup( 1, test)
    Nov 30 11:54:48 Tommy kernel: ETFS: etfs_root_lookup(); List search;
bla1234
    Nov 30 11:54:48 Tommy kernel: ETFS: etfs_root_lookup(); List search;
test
    Nov 30 11:54:58 Tommy kernel: ETFS: etfs_revalidate()
    Nov 30 11:54:58 Tommy kernel: ETFS: etfs_root_lookup( 1, test)
    Nov 30 11:54:58 Tommy kernel: ETFS: etfs_root_lookup(); List search;
bla1234
    Nov 30 11:54:58 Tommy kernel: ETFS: etfs_root_lookup(); List search;
test
    Nov 30 11:54:59 Tommy kernel: ETFS: etfs_revalidate()
    Nov 30 11:54:59 Tommy kernel: ------------[ cut here ]------------
    Nov 30 11:54:59 Tommy kernel: kernel BUG at inode.c:1036!
    Nov 30 11:54:59 Tommy kernel: invalid operand: 0000
    Nov 30 11:54:59 Tommy kernel: etfs nfsd lockd sunrpc autofs 3c59x
ide-scsi scsi_mod ide-cd cdrom mousedev keybdev hid input usb-uhci usbcore
ext3 jbd  
    Nov 30 11:54:59 Tommy kernel: CPU:    0
    Nov 30 11:54:59 Tommy kernel: EIP:    0010:[<c01596f0>]    Tainted: P 
    Nov 30 11:54:59 Tommy kernel: EFLAGS: 00010246
    Nov 30 11:54:59 Tommy kernel: 
    Nov 30 11:54:59 Tommy kernel: EIP is at iput [kernel] 0x250
(2.4.20-20.8)
    Nov 30 11:54:59 Tommy kernel: eax: d8937ff0   ebx: d3eba900   ecx:
00000000   edx: d3eba910
    Nov 30 11:54:59 Tommy kernel: esi: 00000000   edi: d3fc8400   ebp:
d3f21f48   esp: d3f21e90
    Nov 30 11:54:59 Tommy kernel: ds: 0018   es: 0018   ss: 0018
    Nov 30 11:54:59 Tommy kernel: Process ls (pid: 826, stackpage=d3f21000)
    Nov 30 11:54:59 Tommy kernel: Stack: d3fdbb00 d440b00a 00000000 d3fdbb00
d3eba900 00000000 c0157023 d3eba900 
    Nov 30 11:54:59 Tommy kernel:        d440b00a 00000000 d440b00a c014ddbf
d3fdbb00 00000000 d440b006 c014e3c9 
    Nov 30 11:54:59 Tommy kernel:        d3fdba00 d3f21eec 00000000 00000009
00000000 d3eba500 00000000 d440b006 
    Nov 30 11:54:59 Tommy kernel: Call Trace:   [<c0157023>] dput [kernel]
0xb3 (0xd3f21ea8))
    Nov 30 11:54:59 Tommy kernel: [<c014ddbf>] cached_lookup [kernel] 0x5f
(0xd3f21ebc))
    Nov 30 11:54:59 Tommy kernel: [<c014e3c9>] link_path_walk [kernel] 0x3d9
(0xd3f21ecc))
    Nov 30 11:54:59 Tommy kernel: [<c014e8b9>] path_lookup [kernel] 0x39
(0xd3f21f0c))
    Nov 30 11:54:59 Tommy kernel: [<c014eb59>] __user_walk [kernel] 0x49
(0xd3f21f1c))
    Nov 30 11:54:59 Tommy kernel: [<c014aa0f>] vfs_stat [kernel] 0x1f
(0xd3f21f38))
    Nov 30 11:54:59 Tommy kernel: [<c014b08b>] sys_stat64 [kernel] 0x1b
(0xd3f21f70))
    Nov 30 11:54:59 Tommy kernel: [<c012d778>] sys_brk [kernel] 0x108
(0xd3f21f98))
    Nov 30 11:54:59 Tommy kernel: [<c0116920>] do_page_fault [kernel] 0x0
(0xd3f21fb0))
    Nov 30 11:54:59 Tommy kernel: [<c0109150>] error_code [kernel] 0x34
(0xd3f21fb8))
    Nov 30 11:54:59 Tommy kernel: [<c010905f>] system_call [kernel] 0x33
(0xd3f21fc0))
    Nov 30 11:54:59 Tommy kernel: 
    Nov 30 11:54:59 Tommy kernel: 

Is there something special I need to do when I tell the vfs that the dentry
is not valid?

Hope some one know what's going on here...

Thanks,


Eelco





--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux