Skip to content

fuse: add kernel-enforced request timeout option

Joanne Koong linux-fsdevel 7 versions – Applied

Status from this message: Thanks, applied and pushed with some cleanups including Luis's clamp idea.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v12 Latest2 patches 21 repliesApplied
  2. v112 patches 10 repliesSuperseded
  3. v102 patches 20 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v9 posting 2/23 patches34 repliesSuperseded
v9 posting 1/23 patches0 repliesSuperseded
v83 patches8 repliesSuperseded
v73 patches5 repliesSuperseded

Changes in v12 from the cover letter

* Pass request timeout through init instead of mount option (Miklos)
* Change sysctl upper bound to max u16 val
* Rebase on top of for-next, need to incorporate io-uring timeouts

Patches in v12 Applied

#Subject and filesSizeRepliesApplied
1/2fuse: add kernel-enforced timeout option for requestsfs/fuse/dev.c fs/fuse/dev_uring.c fs/fuse/dev_uring_i.h +4 more+178 -30 replies
2/2fuse: add default_request_timeout and max_request_timeout sysctlsDocumentation/admin-guide/sysctl/fs.rst fs/fuse/fuse_i.h fs/fuse/inode.c +1 more+85 -215 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBernd SchubertJosef BacikSergey SenozhatskyJeff LaytonLuis Henriques
SeriesR-b
1/2
2/2R-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v12 thread

Cover letter [PATCH v12 0/2] fuse: add kernel-enforced request timeout option

There are situations where fuse servers can become unresponsive or stuck, for example if the server is in a deadlock. Currently, there's no good way to detect if a server is stuck and needs to be killed manually.

This patchset adds a timeout option where if the server does not reply to a request by the time the timeout elapses, the connection will be aborted. This patchset also adds two dynamically configurable fuse sysctls "default_request_timeout" and "max_request_timeout" for controlling/enforcing timeout behavior system-wide.

Existing systems running fuse servers will not be affected unless they explicitly opt into the timeout.

v11:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v11 -> v12:
* Pass request timeout through init instead of mount option (Miklos)
* Change sysctl upper bound to max u16 val
* Rebase on top of for-next, need to incorporate io-uring timeouts

v10:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v10 -> v11:
* Refactor check for request expiration (Sergey)
* Move workqueue cancellation to earlier in function (Jeff)
* Check fc->num_waiting as a shortcut in workqueue job (Etienne)

v9:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v9 -> v10:
* Use delayed workqueues instead of timers (Sergey and Jeff)
* Change granularity to seconds instead of minutes (Sergey and Jeff)
* Use time_after() api for checking jiffies expiration (Sergey)
* Change timer check to run every 15 secs instead of every min
* Update documentation wording to be more clear

v8:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v8 -> v9:
* Fix comment for u16 fs_parse_result, ULONG_MAX instead of U32_MAX, fix spacing (Bernd)

v7:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v7 -> v8:
* Use existing lists for checking expirations (Miklos)

v6:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v6 -> v7:
- Make timer per-connection instead of per-request (Miklos)
- Make default granularity of time minutes instead of seconds
- Removed the reviewed-bys since the interface of this has changed (now minutes, instead of seconds)

v5:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v5 -> v6:
- Gate sysctl.o behind CONFIG_SYSCTL in makefile (kernel test robot)
- Reword/clarify last sentence in cover letter (Miklos)

v4:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v4 -> v5:
- Change timeout behavior from aborting request to aborting connection (Miklos)
- Clarify wording for sysctl documentation (Jingbo)

v3:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v3 -> v4:
- Fix wording on some comments to make it more clear
- Use simpler logic for timer (eg remove extra if checks, use mod timer API) (Josef)
- Sanity-check should be on FR_FINISHING not FR_FINISHED (Jingbo)
- Fix comment for "processing queue", add req->fpq = NULL safeguard (Bernd)

v2:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v2 -> v3:
- Disarm / rearm timer in dev_do_read to handle race conditions (Bernrd)
- Disarm timer in error handling for fatal interrupt (Yafang)
- Clean up do_fuse_request_end (Jingbo)
- Add timer for notify retrieve requests
- Fix kernel test robot errors for #define no-op functions

v1:
https://lore.kernel.org/linux-fsdevel/[email protected]/
Changes from v1 -> v2:
- Add timeout for background requests
- Handle resend race condition
- Add sysctls

Joanne Koong (2):
fuse: add kernel-enforced timeout option for requests
fuse: add default_request_timeout and max_request_timeout sysctls

 Documentation/admin-guide/sysctl/fs.rst |  25 ++++++
 fs/fuse/dev.c                           | 101 ++++++++++++++++++++++++
 fs/fuse/dev_uring.c                     |  27 +++++++
 fs/fuse/dev_uring_i.h                   |   6 ++
 fs/fuse/fuse_dev_i.h                    |   3 +
 fs/fuse/fuse_i.h                        |  27 +++++++
 fs/fuse/inode.c                         |  41 +++++++++-
 fs/fuse/sysctl.c                        |  24 ++++++
 include/uapi/linux/fuse.h               |  10 ++-
 9 files changed, 261 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.5