Skip to content

9p: Fix refcounting and improve readability in lookup

Tyler Hicks lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 8 repliesIn review
  2. v11 patch 1 replySuperseded

Changes in v2 from the cover letter

- Simplified the first patch, by removing code cleanups, to reduce churn and minimize regression potential in stable trees
+ The resulting changes are *identical* to the v1 submission when patches 1, 2, and 3 are applied
- Added patches 4 and 5 which are additional, minor code cleanups
v1: https://lore.kernel.org/lkml/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/59p: Fix refcounting during full path walks for fid lookupsfs/9p/fid.c+5 -128 replies
2/59p: Track the root fid with its own variable during lookupsfs/9p/fid.c+14 -120 replies
3/59p: Make the path walk logic more clear about when cloning is requiredfs/9p/fid.c+3 -40 replies
4/59p: Remove unnecessary variable for old fids while walking from d_parentfs/9p/fid.c+3 -30 replies
5/59p: Fix minor typo in code commentfs/9p/fid.c+1 -10 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchChristian Schoenebeck
1/5R-b
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] 9p: Fix refcounting and improve readability in lookup

v2:
- Simplified the first patch, by removing code cleanups, to reduce churn and minimize regression potential in stable trees
+ The resulting changes are *identical* to the v1 submission when patches 1, 2, and 3 are applied
- Added patches 4 and 5 which are additional, minor code cleanups
v1: https://lore.kernel.org/lkml/[email protected]/

The primary motivation for this series is patch #1 which fixes a refcounting issue in the path walking code of v9fs_fid_lookup_with_uid(). Userspace can cause fids, which are created for use during lookup, to not be clunked and make the mount unusable.

The remaining patches are code cleanups to improve readability. They're not critical.

I tested v1 and v2 by running fstests against 9p inside of QEMU to ensure that the results were the same as without my changes applied. I also backported patch #1 of v2 to linux-5.15.y (v5.15.32) and ensured that the 'fid not clunked' issue did not occur when running against the Windows Subsystem for Linux (WSL) 9p server.

Tyler

Tyler Hicks (5):
9p: Fix refcounting during full path walks for fid lookups 9p: Track the root fid with its own variable during lookups 9p: Make the path walk logic more clear about when cloning is required 9p: Remove unnecessary variable for old fids while walking from
d_parent
9p: Fix minor typo in code comment

 fs/9p/fid.c | 50 ++++++++++++++++++++++----------------------------
 1 file changed, 22 insertions(+), 28 deletions(-)
Signature · 1 line
2.25.1