Skip to content

namei: clean up retry logic in various do_* functions

Dmitry Kadashev io-uring linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7namei: clean up do_rmdir retry logicfs/namei.c+25 -193 replies
2/7namei: clean up do_unlinkat retry logicfs/namei.c+22 -170 replies
3/7namei: clean up do_mkdirat retry logicfs/namei.c+15 -70 replies
4/7namei: clean up do_mknodat retry logicfs/namei.c+18 -131 reply
5/7namei: clean up do_symlinkat retry logicfs/namei.c+19 -121 reply
6/7namei: clean up do_linkat retry logicfs/namei.c+44 -361 reply
7/7namei: clean up do_renameat retry logicfs/namei.c+20 -160 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/7] namei: clean up retry logic in various do_* functions

Suggested by Linus in https://lore.kernel.org/io-uring/CAHk-=wh=cpt_tQCirzFZRPawRpbuFTZ2MxNpXiyUF+eBXF=+sw@mail.gmail.com/

This patchset does all the do_* functions one by one. The idea is to move the main logic to a helper function and handle stale retries / struct filename cleanups outside, which makes the logic easier to follow.

There is one minor change in the behavior: filename_lookup() / filename_parentat() / filename_create() do their own retries on ESTALE (regardless of flags), and previously they were exempt from retries in the do_* functions (but they *were* called on retry - it's just the return code wasn't checked for ESTALE). And now the retry is done on the upper level, and so technically it could be called a behavior change. Hopefully it's an edge case where an additional check does not matter.

On top of https://lore.kernel.org/io-uring/[email protected]/

Dmitry Kadashev (7):
namei: clean up do_rmdir retry logic
namei: clean up do_unlinkat retry logic
namei: clean up do_mkdirat retry logic
namei: clean up do_mknodat retry logic
namei: clean up do_symlinkat retry logic
namei: clean up do_linkat retry logic
namei: clean up do_renameat retry logic

 fs/namei.c | 283 ++++++++++++++++++++++++++++++-----------------------
 1 file changed, 163 insertions(+), 120 deletions(-)
Signature · 1 line
2.30.2