Skip to contentSkip to conversation

Where's the create() pointer?

DISCUSSION Justin Banks 2 participants 5 messages Jan 19, 2008 – Jan 20, 2008

lore
Share & tools
lore
#0 lore raw

It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the create() (among others) pointer for NFS filesystems.

Specifically, If I look at sb->s_root->d_inode->i_op there's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.

-justinb

Signature · 3 lines
Justin Banks
BakBone Software
[email protected]
#1 lore raw
Quoted 7 lines · Justin Banks

It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the create() (among others) pointer for NFS filesystems.

Specifically, If I look at sb->s_root->d_inode->i_op there's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.

Why would you want to do this in the first place?

Anyhow, to answer the question: sb->s_root is not guaranteed to be a real file on NFS. The real mountpoints are usually in the anonymous dentry list.

Trond

#2 lore raw

Trond Myklebust wrote

Quoted 11 lines · Justin Banks
Quoted 7 lines

It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the create() (among others) pointer for NFS filesystems.

Specifically, If I look at sb->s_root->d_inode->i_op there's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.

Why would you want to do this in the first place?

I'm just looking at trapping new creates on NFS, and so I need to find the pointer.

Quoted 3 lines

Anyhow, to answer the question: sb->s_root is not guaranteed to be a real file on NFS. The real mountpoints are usually in the anonymous dentry list.

Okay, I'll look there, thanks.

-justinb

Signature · 3 lines
Justin Banks
BakBone Software
[email protected]
#3 lore raw
Quoted 11 lines · Justin Banks

Trond Myklebust wrote

Quoted 10 lines · Justin Banks
Quoted 7 lines

It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the create() (among others) pointer for NFS filesystems.

Specifically, If I look at sb->s_root->d_inode->i_op there's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.

Quoted 4 lines
Quoted 1 line

Why would you want to do this in the first place?

I'm just looking at trapping new creates on NFS, and so I need to find the pointer.

What is your purpose in trapping creates on the client? Is this for accounting purposes? If so, why wouldn't inotify, or even a systemtap script suffice?

Anyhow, the simplest way to find the pointer is to grep for nfs_create in /proc/kallsyms.

Trond

#4 lore raw

Trond Myklebust wrote

Quoted 13 lines · Justin Banks
Quoted 11 lines

Trond Myklebust wrote

Quoted 10 lines · Justin Banks
Quoted 7 lines

It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the create() (among others) pointer for NFS filesystems.

Specifically, If I look at sb->s_root->d_inode->i_op there's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Why would you want to do this in the first place?

I'm just looking at trapping new creates on NFS, and so I need to find the pointer.

What is your purpose in trapping creates on the client? Is this for accounting purposes? If so, why wouldn't inotify, or even a systemtap script suffice?

Could do inotify, except on a large-ish filesystem, it's really unuseable, if you want to track everything that's going on.

Quoted 2 lines

Anyhow, the simplest way to find the pointer is to grep for nfs_create in /proc/kallsyms.

Ugh. That's an ugly way, seems to me. Isn't there a way, given the superblock? I mean, the VFS does it that way, doesn't it?

-justinb

Signature · 3 lines
Justin Banks
BakBone Software
[email protected]