Missing fuse backport: "fuse: add feature flag for expire-only"

Bug #2051700 reported by Bernd Schubert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-hwe-6.2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello,

I just noticed that the backport of this patch was not done for linux-6.2 and linux-6.3, I guess because there had been a merge conflict. I think in the mean time these versions are not maintained anymore, so sending a version that fixes the merge conflict is probably not going to help.

Issue is that libfuse currently uses a version check instead of testing for the corresponding feature, which is troublesome with any kind of feature back port. I.e., if the feature back port increases the version number, it would enable the "FUSE_EXPIRE_ONLY" although possibly not back ported. If the back port does not increase the version number, it might be used by libfuse...

commit 5cadfbd5a11e5495cac217534c5f788168b1afd7
Author: Miklos Szeredi <email address hidden>
Date: Mon Mar 27 16:14:49 2023 +0200

    fuse: add feature flag for expire-only

    Add an init flag idicating whether the FUSE_EXPIRE_ONLY flag of
    FUSE_NOTIFY_INVAL_ENTRY is effective.

    This is needed for backports of this feature, otherwise the server could
    just check the protocol version.

    Fixes: 4f8d37020e1f ("fuse: add "expire only" mode to FUSE_NOTIFY_INVAL_ENTRY")
    Cc: <email address hidden> # v6.2
    Signed-off-by: Miklos Szeredi <email address hidden>

Tags: patch
Revision history for this message
Bernd Schubert (aakef) wrote :

This is a back port of the patch to hwe-6.2-next, conflicts had been in the section below, as 6.2 does not have FUSE_CREATE_SUPP_GROUP

Initial patch for 6.5
```
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index d66070af145d0..660be31aaabc2 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1254,7 +1254,8 @@ void fuse_send_init(struct fuse_mount *fm)
                FUSE_ABORT_ERROR | FUSE_MAX_PAGES | FUSE_CACHE_SYMLINKS |
                FUSE_NO_OPENDIR_SUPPORT | FUSE_EXPLICIT_INVAL_DATA |
                FUSE_HANDLE_KILLPRIV_V2 | FUSE_SETXATTR_EXT | FUSE_INIT_EXT |
- FUSE_SECURITY_CTX | FUSE_CREATE_SUPP_GROUP;
+ FUSE_SECURITY_CTX | FUSE_CREATE_SUPP_GROUP |
+ FUSE_HAS_EXPIRE_ONLY;

```

Back ported version:
```
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 06876afe5ae46..a86270fa2bf5f 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1255,7 +1255,7 @@ void fuse_send_init(struct fuse_mount *fm)
                FUSE_ABORT_ERROR | FUSE_MAX_PAGES | FUSE_CACHE_SYMLINKS |
                FUSE_NO_OPENDIR_SUPPORT | FUSE_EXPLICIT_INVAL_DATA |
                FUSE_HANDLE_KILLPRIV_V2 | FUSE_SETXATTR_EXT | FUSE_INIT_EXT |
- FUSE_SECURITY_CTX;
+ FUSE_SECURITY_CTX | FUSE_HAS_EXPIRE_ONLY;
 #ifdef CONFIG_FUSE_DAX
        if (fm->fc->dax)
                flags |= FUSE_MAP_ALIGNMENT;
```

Right now I didn't try to compile it yet, but could do if needed.

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.