mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fuse: use min_not_zero() in fuse_init_server_timeout()
@ 2026-07-31 15:44 Sang-Heon Jeon
  2026-07-31 17:29 ` Joanne Koong
  2026-08-18 12:35 ` Miklos Szeredi
  0 siblings, 2 replies; 3+ messages in thread
From: Sang-Heon Jeon @ 2026-07-31 15:44 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: fuse-devel, linux-kernel

fuse_init_server_timeout() limits timeout to fuse_max_req_timeout with
the same logic as min_not_zero(), and returns early exactly when the
computed timeout would be zero.

So use min_not_zero() instead and return when the computed timeout is
zero.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 fs/fuse/req_timeout.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/fs/fuse/req_timeout.c b/fs/fuse/req_timeout.c
index 6cc6fc491343..95a1acd7bc08 100644
--- a/fs/fuse/req_timeout.c
+++ b/fs/fuse/req_timeout.c
@@ -128,18 +128,12 @@ static void set_request_timeout(struct fuse_chan *fch, unsigned int timeout)
 
 void fuse_init_server_timeout(struct fuse_chan *fch, unsigned int timeout)
 {
-	if (!timeout && !fuse_max_req_timeout && !fuse_default_req_timeout)
-		return;
-
 	if (!timeout)
 		timeout = fuse_default_req_timeout;
 
-	if (fuse_max_req_timeout) {
-		if (timeout)
-			timeout = min(fuse_max_req_timeout, timeout);
-		else
-			timeout = fuse_max_req_timeout;
-	}
+	timeout = min_not_zero(timeout, fuse_max_req_timeout);
+	if (!timeout)
+		return;
 
 	timeout = max(FUSE_TIMEOUT_TIMER_FREQ, timeout);
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fuse: use min_not_zero() in fuse_init_server_timeout()
  2026-07-31 15:44 [PATCH] fuse: use min_not_zero() in fuse_init_server_timeout() Sang-Heon Jeon
@ 2026-07-31 17:29 ` Joanne Koong
  2026-08-18 12:35 ` Miklos Szeredi
  1 sibling, 0 replies; 3+ messages in thread
From: Joanne Koong @ 2026-07-31 17:29 UTC (permalink / raw)
  To: Sang-Heon Jeon; +Cc: Miklos Szeredi, fuse-devel, linux-kernel

On Fri, Jul 31, 2026 at 8:44 AM Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
>
> fuse_init_server_timeout() limits timeout to fuse_max_req_timeout with
> the same logic as min_not_zero(), and returns early exactly when the
> computed timeout would be zero.
>
> So use min_not_zero() instead and return when the computed timeout is
> zero.
>
> No functional change.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>

Reviewed-by: Joanne Koong <joannelkoong@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fuse: use min_not_zero() in fuse_init_server_timeout()
  2026-07-31 15:44 [PATCH] fuse: use min_not_zero() in fuse_init_server_timeout() Sang-Heon Jeon
  2026-07-31 17:29 ` Joanne Koong
@ 2026-08-18 12:35 ` Miklos Szeredi
  1 sibling, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2026-08-18 12:35 UTC (permalink / raw)
  To: Sang-Heon Jeon; +Cc: fuse-devel, linux-kernel

On Fri, 31 Jul 2026 at 17:47, Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
>
> fuse_init_server_timeout() limits timeout to fuse_max_req_timeout with
> the same logic as min_not_zero(), and returns early exactly when the
> computed timeout would be zero.
>
> So use min_not_zero() instead and return when the computed timeout is
> zero.

Applied, thanks.

Miklos

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-18 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-31 15:44 [PATCH] fuse: use min_not_zero() in fuse_init_server_timeout() Sang-Heon Jeon
2026-07-31 17:29 ` Joanne Koong
2026-08-18 12:35 ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®