Re: Regarding Wrapfs Code - function wrapfs_interpose

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

 



In message <1144501811.13374.13.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Avishay Traeger writes:
> On Fri, 2006-04-07 at 21:51 -0700, UZAIR LAKHANI wrote:
> > I want to find out the purpose of a part of Wrapfs
> > code.
> > 
> > The function name is wrapfs_interpose
> > 
> > The code is
> > 
> > /* check that the lower file system didn't cross a
> > mount point */
> > 	if (lower_inode->i_sb != SUPERBLOCK_TO_LOWER(sb)) {
> > 		err = -EXDEV;
> > 		goto out;
> > 	}
> > 
> > I want to find out what is the purpose of the above
> > check.
> 
> Exactly what the comment says - it checks to make sure that we didn't
> cross a mount point.  It does this by making sure that the lower-level
> superblock of this lower-level inode is the same as the lower-level
> superblock that we expect (the one used at mount-time).  So basically,
> if we see a superblock that is different from the one we usually use, we
> crossed a mount point and so we return an error.
> 
> Avishay Traeger
> http://www.fsl.cs.sunysb.edu/~avishay/

More detail.

In its default mode, Wrapfs generates inode numbers by inheriting the inum
of the lower inode: that way we are guaranteed unique inodes, and a fast
operation to generate inodes.  But if you cross into a new sb, you could
clash with other inodes that have the same inum (confusing the icache) -- so
the default alg doesn't work unless we prohibit you from crossing into lower
sb's.

Wrapfs supports therefore another mode in which we use iunique() to generate
unique inums.  In this mode you *can* cross into new sb's, but the
disadvantage now is that your inums are not persistent (this can mess up
certain tools like tar/find, and NFS).

In Unionfs we implemented yet another alternative (called "imap" or Inode
Map).  We generate unique inums, but we store them persistently on the lower
f/s, in a special mapping file.  That way we can map our own stacked inums
to the lower ones.  So this allows you to cross into any number of sb's, and
it works with NFS (client/server) and with tools like tar and find.  Problem
is, performance now suffers each time you have to consult the i-mapping file
to translate b/t upper and lower inums.

Erez.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux