Skip to content

Fixups for l_pid

Benjamin Coddington ceph-devel cluster-devel linux-cifs linux-fsdevel lkml lustre-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 1 replyIn review
  2. v52 patches 8 repliesSuperseded
  3. v43 patches 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches5 repliesSuperseded
v23 patches1 replySuperseded
v13 patches15 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fs/locks: Use allocation rather than the stack in fcntl_getlk()fs/locks.c+26 -200 replies
2/3fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locksfs/fuse/file.c fs/locks.c include/linux/fs.h+41 -290 replies
3/3staging/lustre, 9p, ceph, cifs, dlm: negate remote pids for F_GETLKdrivers/staging/lustre/lustre/ldlm/ldlm_flock.c fs/9p/vfs_file.c fs/ceph/locks.c +2 more+5 -51 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH 0/3 v6] Fixups for l_pid

LTP fcntl tests (fcntl11 fcntl14 fcntl17 fcntl19 fcntl20 fcntl21) have been failing for NFSv4 mounts due to an unexpected l_pid. What follows are some fixups:

v2: - Rebase onto linux-next
- Revert back to using the stack in locks_mandatory_area(), and fixup patch description for 1/3

v3: - The lkp-robot found some serious per_thread_ops performance
regressions for v1 and v2, so this version changes things around to not acquire a reference to struct pid in fl_nspid for every lock. Instead, it drops fl_nspid altogether, and defers the lookup of the namespace-translated pid until it actually needed.

v4: - Instead of looking up the virtual pid by way of referencing the struct
task of the that pid, instead use find_pid_ns() and pid_nr_ns(), which avoids a the problem where we race to get a reference to the struct task while it may be freed.

v5: - Squash previous 2/3 and 3/3 to avoid regression where F_GETLK would
return the init_ns pid instead of a translated pid.

v6: - State clearly how the differing cases of l_pid translation should be
handled, specifically regarding remote locks on remote files: that fl_pid ought to be returned from the filesystem as <= 0 to indicate that it makes no sense to translate this l_pid.
- Follow up with a patch to have filesystems negate fl_pid for remote locks on remote files.

Benjamin Coddington (3):
fs/locks: Use allocation rather than the stack in fcntl_getlk() fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks staging/lustre, 9p, ceph, cifs, dlm: negate remote pids for F_GETLK

 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |   2 +-
 fs/9p/vfs_file.c                                |   2 +-
 fs/ceph/locks.c                                 |   2 +-
 fs/cifs/cifssmb.c                               |   2 +-
 fs/dlm/plock.c                                  |   2 +-
 fs/fuse/file.c                                  |   6 +-
 fs/locks.c                                      | 108 ++++++++++++++----------
 include/linux/fs.h                              |   2 +-
 8 files changed, 72 insertions(+), 54 deletions(-)
Signature · 1 line
2.9.3