RE: Getting full pathname for dentry (fwd)

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

 



you can also try the code here: http://www.cs.bgu.ac.il/~tzachar/file.c
i wrote it a while back, and sure, its a little _misguided_, but it
worked for me (so everyone, please dont torch me .... ;)

I tried it but it didn't cross the mount point.
Finally i've got a solution... :-)
The problem is that there is not a unique vfsmount for a dentry. If for example /dev/hda3 is mounted on /mnt/stuff and /mnt/other then the dentries for /mnt/stuff/file1 and /mnt/other/file1 are the same but the vfsmounts are different.
The solution for this is described here: http://mail.wirex.com/pipermail/linux-security-module/2003-July/4609.html
You have to go through the whole namespace and search for matches.


Although this is quite inefficient i don't have a better solution for the time being.
The reason why i need to know the full pathname is that my module informs a daemon about every alteration of the filesystem. The daemon mirrors the filesystem structure (just pathnames). So if a user types
rm /dir1/file1
the daemon needs to remove this pathname from its database. It's necessary to store the full pathname because the dameon gets requests like "where is file foo1 on the disk?" (similar to locate). If anyone can think about a more efficient architecture for this i would be very thankfull!


Regards

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



-- 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