From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org, steved@redhat.com,
trond.myklebust@fys.uio.no, aviro@redhat.com
Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com,
nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/5] Permit NFS superblock sharing [try #3]
Date: Thu, 02 Mar 2006 21:33:56 +0000 [thread overview]
Message-ID: <20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com> (raw)
These patches make it possible to share NFS superblocks between related mounts,
where "related" means on the same server. Inodes and dentries will be shared
where the NFS filehandles are the same (for example if two NFS3 files come from
the same export but from different mounts, such as is not uncommon with autofs
on /home).
Following discussion with Al Viro, the following changes [try #2] have been
made to the previous attempt at this set of patches:
(*) The vfsmount is now passed into the get_sb() method for a filesystem
instead of passing a pointer to a pointer to a dentry into which get_sb()
could stick a root dentry if it wanted. get_sb() now instantiates the
superblock and root dentry pointers in the vfsmount itself.
(*) The get_sb() method now returns an integer (0 or -ve error number) rather
than the superblock pointer or cast error number.
(*) the get_sb_*() convenience functions in the core kernel now take a
vfsmount pointer argument and return an integer, so most filesystems have
to change very little.
(*) If one of the convenience function is not used, then get_sb() should
normally call simple_set_mnt() to instantiate the vfsmount. This will
always return 0, and so can be tail-called from get_sb().
(*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
dcache upon superblock destruction rather than shrink_dcache_parent() and
shrink_dcache_anon(). This is because, as far as I can tell, the current
code assumes that all the dentries will be linked into a tree depending
from sb->s_root, and that anonymous dentries won't have children.
However, with the way these patches implement NFS superblock sharing,
these assumptions are violated: the root of the filesystem is simply a
dummy dentry and inode (the real inode for '/' may well be inaccessible),
and all the vfsmounts are rooted on anonymous[*] dentries with child
trees.
[*] Anonymous until discovered from another tree.
(*) d_materialise_dentry() now switches the parentage of the two nodes around
correctly when one or other of them is self-referential.
(*) Whilst invoking link_path_walk(), the nfs4_get_root() routine now
temporarily overrides the FS settings of the process to prevent absolute
symbolic links from walking into the wrong namespace.
(*) nfs*_get_sb() instantiate the supplied vfsmount directly by assigning to
its mnt_root and mnt_sb members.
(*) nfs_readdir_lookup() creates dentries for each of the entries readdir()
returns; this function now attaches disconnected trees from alternate
roots that happen to be discovered attached to a directory being read (in
the same way nfs_lookup() is made to do for lookup ops).
(*) Various bugs have been fixed.
Further changes [try #3] that have been made:
(*) The patches are now against Trond's NFS git tree, so won't apply to
Linus's tree.
(*) The server record construction/destruction has been abstracted out into
its own pair of functions to make things easier to get right.
(*) Documentation changes have been moved from patch 2/5 to 1/5.
David
next reply other threads:[~2006-03-02 21:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 21:33 David Howells [this message]
2006-03-02 21:33 ` [PATCH 1/5] NFS: Permit filesystem to override root dentry on mount [try #3] David Howells
2006-03-02 21:34 ` [PATCH 2/5] NFS: Apply mount root dentry override to filesystems " David Howells
2006-03-02 21:34 ` [PATCH 3/5] NFS: Abstract out namespace initialisation " David Howells
2006-03-02 21:34 ` [PATCH 4/5] NFS: Add dentry materialisation op " David Howells
2006-03-02 21:34 ` [PATCH 5/5] NFS: Unify NFS superblocks per-protocol per-server " David Howells
2006-03-03 3:22 ` Andrew Morton
2006-03-02 22:07 ` [PATCH 0/5] Permit NFS superblock sharing " Linus Torvalds
2006-03-03 9:59 ` [PATCH 5/5] NFS: Unify NFS superblocks per-protocol per-server [try #3a] David Howells
2006-03-03 10:49 ` [PATCH 6/5] 9p: Fix error handling on superblock alloc failure David Howells
2006-03-03 11:30 ` [PATCH 7/5] Optimise d_find_alias() David Howells
2006-03-03 11:45 ` Andrew Morton
2006-03-03 14:48 ` Matthew Wilcox
2006-03-03 15:46 ` Al Viro
2006-03-03 13:00 ` David Howells
2006-03-03 15:43 ` Ingo Molnar
2006-03-03 13:01 ` David Howells
2006-03-03 13:38 ` [PATCH 7/5] Optimise d_find_alias() [try #2] David Howells
2006-03-04 12:16 ` [PATCH 0/5] Permit NFS superblock sharing [try #3] Andrew Morton
2006-03-06 11:55 ` David Howells
2006-03-06 13:57 ` Jörn Engel
2006-03-06 15:25 ` Linus Torvalds
2006-03-06 14:03 ` [PATCH 1/5] NFS: Permit filesystem to override root dentry on mount [try #4] David Howells
2006-03-06 14:59 ` [PATCH 1+2/5] NFS: Permit filesystem to override root dentry on mount [try #5] David Howells
2006-03-07 11:08 ` [PATCH] Fix multiple blockdev-based filesystem mounts David Howells
2006-03-07 11:35 ` Alexander Viro
2006-03-07 13:23 ` David Howells
2006-05-23 16:53 ` [PATCH 0/5] Permit NFS superblock sharing [try #3] David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=aviro@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
--cc=steved@redhat.com \
--cc=torvalds@osdl.org \
--cc=trond.myklebust@fys.uio.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).