Skip to content

overlayfs lock ordering changes

Amir Goldstein linux-unionfs 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 0 repliesNew
  2. v23 patches 11 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Separate mnt_writers and sb_writers locks during copy up
- Fixs error handling bugs found by Miklos

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ovl: reorder ovl_want_write() after ovl_inode_lock()fs/overlayfs/copy_up.c fs/overlayfs/dir.c fs/overlayfs/export.c +2 more+84 -870 replies
2/4ovl: split ovl_want_write() into two helpersfs/overlayfs/overlayfs.h fs/overlayfs/util.c+30 -00 replies
3/4ovl: do not open/llseek lower file with upper sb_writers heldfs/overlayfs/copy_up.c fs/overlayfs/util.c+61 -230 replies
4/4ovl: do not encode lower fh with upper sb_writers heldfs/overlayfs/copy_up.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h +2 more+103 -430 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/4] overlayfs lock ordering changes

Hi Miklos,

I went for the less intrusive approach of holding mnt_writers only throughout copy up instead of a long lived elevated refcount. We could reconsider the long lived reference in the future.

Thanks,
Amir.

Changes since v2:
- Separate mnt_writers and sb_writers locks during copy up
- Fixs error handling bugs found by Miklos

Changes since v1:
- Breakup the large ovl_want_write() transaction in copy up
- Add fix to possible deadlock with encode lower ovl fh

Amir Goldstein (4):
ovl: reorder ovl_want_write() after ovl_inode_lock()
ovl: split ovl_want_write() into two helpers
ovl: do not open/llseek lower file with upper sb_writers held
ovl: do not encode lower fh with upper sb_writers held

 fs/overlayfs/copy_up.c   | 141 +++++++++++++++++++++++++--------------
 fs/overlayfs/dir.c       |  60 ++++++++---------
 fs/overlayfs/export.c    |   7 +-
 fs/overlayfs/inode.c     |  57 ++++++++--------
 fs/overlayfs/namei.c     |  37 +++++++---
 fs/overlayfs/overlayfs.h |  30 +++++++--
 fs/overlayfs/super.c     |  20 ++++--
 fs/overlayfs/util.c      |  73 ++++++++++++++++++--
 8 files changed, 275 insertions(+), 150 deletions(-)
Signature · 1 line
2.34.1