[PATCH 0/5 RFC] VFS: introduce new APIs to be used for directory locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following 5 patches, which may depend on some of the earlier patches
I have sent, introduce new interfaces for requesting name-based
operations on directories (create, remove, rename).  They generally
combine the lookup and the lock operations and return a dentry which is
"locked".

Currently a dentry is always locked by locking the parent directory.
Once all clients are converted to use these interfaces we will be free to
change the details of the locking.  My proposal is to lock just the
relevant dentrys in a manner somewhat similar to the way that
d_in_lookup() dentrys are currently locked.

After the intended operation is completed (or aborted) the dentry is
unlocked with dentry_unlock().  This currently unlocks the parent
directory and dputs the dentry.  It is because the unlock is given just
the dentry, that one of my earlier patches changed vfs_mkdir() to drop
the lock when it consumes the dentry without replacing it (i.e.  in case
of error).  In that case there is nothing to pass to dentry_unlock().

I have a follow-on set of patches which change various parts of the
kernel to use these APIs instead of directly locking the parent.
They cover smb/server, nfsd, cachefiles, debugfs, binderfs, binfmt_misc,
kernel/bpf, devpts, fuse, infiniband.../qib_fs, ipc/mqueue, fs/proc,
s390/hypfs, security, sunrpc/rpc_pipe, xfs, tracefs.  overlayfs needs
some rearrangement of locking before it can be converted - that is on my
short-list of tasks.  I don't plan on a full submission of these APIs
until that is completed, in case I find a need for changes.


Thanks,
NeilBrown


 [PATCH 1/5] VFS: introduce lookup_and_lock() and friends
 [PATCH 2/5] VFS/btrfs: add lookup_and_lock_killable()
 [PATCH 3/5] VFS: change old_dir and new_dir in struct renamedata to
 [PATCH 4/5] VFS: add lookup_and_lock_rename()
 [PATCH 5/5] VFS: introduce lock_and_check_dentry()




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux