Skip to content

fuse: don't stuck clients on retrieve_notify with size > max_write

Kirill Smelkov linux-fsdevel stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fuse: retrieve: cap requested size to negotiated max_writefs/fuse/dev.c+1 -10 replies
2/2fuse: require /dev/fuse reads to have enough buffer capacity as negotiatedfs/fuse/dev.c+10 -00 replies
2/2fuse: require /dev/fuse reads to have enough buffer capacity as negotiatedfs/fuse/dev.c+10 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RESEND3, PATCH 0/2] fuse: don't stuck clients on retrieve_notify with size > max_write

Miklos,

Quoted 22 lines · Kirill Smelkov
Quoted 12 lines · Miklos Szeredi
Quoted 9 lines · Kirill Smelkov

I more or less agree with this statement. However can we please make the breakage to be explicitly visible with an error instead of exhibiting it via harder to debug stucks/deadlocks? For example sys_read < max_write -> error instead of getting stuck. And if notify_retrieve requests buffer larger than max_write -> error or cut to max_write, but don't return OK when we know we will never send what was requested to filesystem even if it uses max_write sized reads. What is the point of breaking in hard to diagnose way when we can make the breakage showing itself explicitly? Would a patch for such behaviour accepted?

Quoted 2 lines

Sure, if it's only adds a couple of lines. Adding more than say ten
lines for such a non-bug fix is definitely excessive.

Ok, thanks. Please consider applying the following patch. (It's a bit pity to hear the problem is not considered to be a bug, but anyway).

I will also send the second patch as another mail, since I could not made git am --scissors to apply several patched extracted from one mail successfully.

[...]

Quoted 2 lines · Kirill Smelkov

Ping. Miklos, is there anything wrong with this patch and its second counterpart?

As we were talking here are those patches. The first one cuts notify_retrieve request to max_write and is one line only. The second one returns error to filesystem server if it is buggy and does sys_read with buffer size < max_write. It is 2 lines of code and 7 lines of comments.

I still think that the patches fix real bugs. It is a bug if server behaviour is a bit non-confirming or simply on an edge of being correct or questionable, and instead of properly getting plain error from kernel, the whole system gets stuck. It is a bug because bug amplification factor here is at least one order of magnitude instead of staying ~1x.

I'm sending the patches for the third time already, but did not get any feedback. Could you please have a look?

Thanks beforehand,
Kirill

Kirill Smelkov (2):
fuse: retrieve: cap requested size to negotiated max_write
fuse: require /dev/fuse reads to have enough buffer capacity as negotiated

 fs/fuse/dev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Signature · 1 line
2.21.0.225.g810b269d1a