From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [RFC][PATCH 0/4] ovl: Do not hold s_vfs_rename_mutex during data copy up
Date: Sat, 12 Nov 2016 21:36:00 +0200 [thread overview]
Message-ID: <1478979364-10355-1-git-send-email-amir73il@gmail.com> (raw)
With these changes, different files data can be copied up concurrently and
data copy up will not block copy up of other files nor will it block other
rename operations on the underlaying fs.
Following 3 cleanup patches, the last patch implements the following locking
scheme:
Directories:
<maybe> inode_lock(ovl_inode)
lock_rename(workdir, upperdir)
copy up dir to workdir
move dir to upperdir
Special and zero size files:
inode_lock(ovl_inode)
lock_rename(workdir, upperdir)
copy up file to workdir (no data)
move file to upperdir
Regular files with data:
inode_lock(ovl_inode)
lock_rename(workdir, upperdir)
copy up file to workdir (no data)
unlock_rename(workdir, upperdir)
copy data to file in workdir
lock_rename(workdir, upperdir)
move file to upperdir
Those changes are sanitity tested with xfstest -g quick, pjdfstest and
unionmount-testsuite.
Also tested that during copy up of 4gb file, it is possible to touch small files
on same overlay without blocking and rename files in underlying fs
Rename or touch the 4gb file before copy up is done will block until copy up is
done and complete there after.
Amir Goldstein (4):
vfs: update documentation for inode operation locking rules
ovl: add helper ovl_dentry_is_upper()
ovl: fold ovl_copy_up_truncate() into ovl_copy_up()
ovl: allow concurrent copy up data of differnt files
Documentation/filesystems/Locking | 27 +++++-----
fs/overlayfs/copy_up.c | 100 ++++++++++++++++++++++++++++++++------
fs/overlayfs/dir.c | 4 +-
fs/overlayfs/inode.c | 36 ++------------
fs/overlayfs/overlayfs.h | 4 +-
fs/overlayfs/readdir.c | 2 +-
fs/overlayfs/util.c | 7 +++
7 files changed, 116 insertions(+), 64 deletions(-)
--
2.7.4
next reply other threads:[~2016-11-12 19:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-12 19:36 Amir Goldstein [this message]
2016-11-12 19:36 ` [RFC][PATCH 1/4] vfs: update documentation for inode operation locking rules Amir Goldstein
2016-11-12 19:36 ` [RFC][PATCH 2/4] ovl: add helper ovl_dentry_is_upper() Amir Goldstein
2016-11-12 19:36 ` [RFC][PATCH 3/4] ovl: fold ovl_copy_up_truncate() into ovl_copy_up() Amir Goldstein
2016-12-03 17:04 ` Amir Goldstein
2016-12-05 14:51 ` Miklos Szeredi
2016-11-12 19:36 ` [RFC][PATCH 4/4] ovl: allow concurrent copy up data of different files Amir Goldstein
2016-11-15 15:56 ` Vivek Goyal
2016-11-15 19:20 ` Amir Goldstein
2016-11-15 21:57 ` Vivek Goyal
2016-11-16 5:27 ` Amir Goldstein
2016-11-20 8:27 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478979364-10355-1-git-send-email-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=koct9i@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).