Skip to content

cifs: implement proper hardlink detection

Jeff Layton linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13cifs: have cifs_NTtimeToUnix take a little-endian argfs/cifs/cifsproto.h fs/cifs/file.c fs/cifs/inode.c +2 more+20 -231 reply
2/13cifs: make cnvrtDosUnixTm take a little-endian args and an offsetfs/cifs/cifsproto.h fs/cifs/cifssmb.c fs/cifs/netmisc.c +1 more+18 -341 reply
3/13cifs: allow get_cifs_acl to be called without an inodefs/cifs/cifsacl.c+6 -194 replies
4/13cifs: rename cifs_iget to cifs_root_igetfs/cifs/cifsfs.c fs/cifs/cifsfs.h fs/cifs/inode.c+3 -30 replies
5/13cifs: add new cifs_fattr struct for holding cifs inode attributes in common wayfs/cifs/cifsglob.h+23 -01 reply
6/13cifs: add new cifs_iget function and convert unix codepath to use itfs/cifs/cifsfs.h fs/cifs/cifsglob.h fs/cifs/cifsproto.h +2 more+247 -1911 reply
7/13cifs: convert posix readdir codepath to use cifs_igetfs/cifs/readdir.c+153 -1460 replies
8/13cifs: convert cifs_get_inode_info to use cifs_igetfs/cifs/cifsacl.c fs/cifs/cifsglob.h fs/cifs/cifsproto.h +1 more+175 -2150 replies
9/13cifs: convert non-posix readdir codepath to use cifs_igetfs/cifs/cifsglob.h fs/cifs/inode.c fs/cifs/readdir.c+96 -2650 replies
10/13cifs: remove cifs_new_inodefs/cifs/cifsproto.h fs/cifs/inode.c+0 -440 replies
11/13cifs: make serverino the default when mountingfs/cifs/connect.c+2 -00 replies
12/13cifs: remove cifsInodeInfo->inUse counterfs/cifs/cifsfs.c fs/cifs/cifsglob.h+0 -20 replies
13/13cifs: remove "hardlink detection" from cifs_renamefs/cifs/inode.c+1 -590 replies

Reviews trailers per patch

2 of 13 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/13R-b
2/13R-b
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/13] cifs: implement proper hardlink detection

This is a second pass at a patchset to implement proper hardlink handling in CIFS. The first set was posted a little more than a month ago and only implemented this for mounts with posix extensions. This patchset should also implement it for non-posix mounts, as long as the server is capable of reporting uniqueid's.

The idea here is to add a new cifs_fattr struct that acts as a container for file attributes returned by the server. Each "dialect" has a translation routine that converts the info returned by the server to this container.

This approach allows us to use iget5_locked get references to inodes, which allows us to identify hardlinks at inode instantiation time. It also results in around a 250 line reduction in code. This is mostly due to the fact that the patchset eliminates a lot of cut-and-paste code duplication and some hardlink handling hackery that should no longer be needed.

The set should be bisectable if committed in order, but I've not done any real testing on anything but the complete set. I've also only tested it with the most commonly used options (posix extensions and nounix). The less commonly traveled codepaths also need to be tested (cifsacl, sfu, etc).

I see this as 2.6.31 material.

Comments and suggestions appreciated.

Jeff Layton (13):
cifs: have cifs_NTtimeToUnix take a little-endian arg
cifs: make cnvrtDosUnixTm take a little-endian args and an offset
cifs: allow get_cifs_acl to be called without an inode
cifs: rename cifs_iget to cifs_root_iget
cifs: add new cifs_fattr struct for holding cifs inode attributes in
common way
cifs: add new cifs_iget function and convert unix codepath to use it
cifs: convert posix readdir codepath to use cifs_iget
cifs: convert cifs_get_inode_info to use cifs_iget
cifs: convert non-posix readdir codepath to use cifs_iget
cifs: remove cifs_new_inode
cifs: make serverino the default when mounting
cifs: remove cifsInodeInfo->inUse counter
cifs: remove "hardlink detection" from cifs_rename

 fs/cifs/cifsacl.c   |   50 ++--
 fs/cifs/cifsfs.c    |    3 +-
 fs/cifs/cifsfs.h    |   15 +-
 fs/cifs/cifsglob.h  |   29 ++-
 fs/cifs/cifsproto.h |   19 +-
 fs/cifs/cifssmb.c   |    4 +-
 fs/cifs/connect.c   |    2 +
 fs/cifs/dir.c       |   25 +-
 fs/cifs/file.c      |    2 +-
 fs/cifs/inode.c     |  811 ++++++++++++++++++++++-----------------------------
 fs/cifs/netmisc.c   |   24 +-
 fs/cifs/readdir.c   |  571 +++++++++++++------------------------
 12 files changed, 649 insertions(+), 906 deletions(-)