[Devel] [PATCH 0/8] ms/nfs: handle client id collision between VEs

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Jan 24 19:51:35 MSK 2022


We see EIO error when opening for creation a file on the nfs mount, when
this mount is mounted in multiple containers with same default hostname
"localhost" unchanged. Because nfs server sees same client ids for all
containers it fails to manage leases for them right.

Let's port mainstream functionality to add additional unique id per-net
namespace which is inserted into client id and saves us from client id
collisions.

To configure just write id to /sys/fs/nfs/net/nfs_client/identifier.
Tricky part here is that sysfs remembers in which netns it was mounted,
before writing we should enter container netns and create temporary
mntns with new sysfs mounted to /sys.

Note: this sysfs file is not visible inside ve, as we don't want
container to change it's unique id.

https://jira.sw.ru/browse/PSBM-137154

David Howells (1):
  Provide a function to create a NUL-terminated string from unterminated
    data

Saurav Girepunje (1):
  fs: nfs: sysfs: Remove NULL check before kfree

Trond Myklebust (6):
  NFS: Create a root NFS directory in /sys/fs/nfs
  NFS: Cleanup - add nfs_clients_exit to mirror nfs_clients_init
  NFS: Add sysfs support for per-container identifier
  NFSv4: Clean up initialisation of uniquified client id strings
  NFSv4: Use the net namespace uniquifier if it is set
  NFSv4: Fix up RCU annotations for struct nfs_netns_client

 fs/nfs/Makefile        |   3 +-
 fs/nfs/client.c        |  15 +++-
 fs/nfs/inode.c         |  10 ++-
 fs/nfs/internal.h      |   2 +-
 fs/nfs/netns.h         |   3 +
 fs/nfs/nfs4proc.c      |  88 ++++++++++---------
 fs/nfs/sysfs.c         | 191 +++++++++++++++++++++++++++++++++++++++++
 fs/nfs/sysfs.h         |  25 ++++++
 include/linux/string.h |   1 +
 mm/util.c              |  24 ++++++
 10 files changed, 316 insertions(+), 46 deletions(-)
 create mode 100644 fs/nfs/sysfs.c
 create mode 100644 fs/nfs/sysfs.h

-- 
2.33.1



More information about the Devel mailing list