linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] cifs: make posix codepaths handle hardlinks appropriately (RFC)
@ 2009-04-05 13:09 Jeff Layton
  2009-04-05 13:09 ` [PATCH 1/3] cifs: rename cifs_iget to cifs_root_iget Jeff Layton
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jeff Layton @ 2009-04-05 13:09 UTC (permalink / raw)
  To: linux-cifs-client; +Cc: linux-fsdevel

This patchset represents a first draft at making cifs detect hardlinks
at inode creation time.

Currently, cifs has a pretty broken mechanism where all dentries get a
new inode and hardlinks aren't handled at the VFS layer. Presumably this
is because getting inode numbers from windows servers has a performance
cost (separate call to the server).

The problem is that hardlinks aren't detected by the VFS so we have to
try to detect them when we think it will matter. It also means that
there isn't cache consistency between hardlinked inodes.

This patch is intended as a first stab at changing this for inodes on
posix mounts. With posix extensions we generally get a "uniqueid" value
for free from the server when we get inode attributes.

The SNIA docs state that the UniqueId is unique in the scope of the
share, and the MS docs seem to hint that it's per-machine unique value.
Either way, I think it's safe enough not to worry about collisions. With
this change, we'll probably want to make "serverino" the default (and
maybe make it hardcoded on) when posix extensions are enabled.

This set just focuses on the posix extension codepaths. Once I get this
settled, I'll take a crack at fixing up the non-posix codepaths
similarly (they'll be a bit more work -- more functions will need to
be broken up, etc).

The set here seems to work, but there's still more to be done:

1) how to handle an unexpected inode number change (consider a rename or
a delete and recreate event that happens from another client or server).
Right now, I'm not detecting this, but I think we probably need to
consider what to do for it.

2) how to deal with non-posix extensions? When serverino is disabled, I
think we'll want to use iunique() to generate new inode numbers. We
could also consider making that the default as well.

Anyway...the set isn't quite complete, but I'd like to post this to
gather comments and suggestions and as a checkpoint to make sure I'm
doing this reasonably correctly.

Jeff Layton (3):
  cifs: rename cifs_iget to cifs_root_iget
  cifs: add new cifs_iget_unix_basic function
  cifs: add cifs_iget_unix and have readdir codepath use it

 fs/cifs/cifsfs.c    |    2 +-
 fs/cifs/cifsfs.h    |   15 +++++-
 fs/cifs/cifsglob.h  |    1 +
 fs/cifs/cifsproto.h |    8 ++-
 fs/cifs/dir.c       |   12 ++--
 fs/cifs/inode.c     |  158 ++++++++++++++++++++++++++++++++++++--------------
 fs/cifs/readdir.c   |  147 +++++++++++++++++++++++++++++++++++------------
 7 files changed, 251 insertions(+), 92 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-10 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-05 13:09 [PATCH 0/3] cifs: make posix codepaths handle hardlinks appropriately (RFC) Jeff Layton
2009-04-05 13:09 ` [PATCH 1/3] cifs: rename cifs_iget to cifs_root_iget Jeff Layton
2009-04-05 13:42   ` [linux-cifs-client] " Christoph Hellwig
2009-04-05 13:54     ` Jeff Layton
2009-04-05 13:09 ` [PATCH 2/3] cifs: add new cifs_iget_unix_basic function Jeff Layton
2009-04-08 17:05   ` [linux-cifs-client] " Christoph Hellwig
2009-04-10 13:18     ` Jeff Layton
2009-04-05 13:09 ` [PATCH 3/3] cifs: add cifs_iget_unix and have readdir codepath use it Jeff Layton

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