[PATCH] Make conn->want/want_ext conversion non fatal
authorBernd Schubert <bschubert@ddn.com>
Sat, 17 May 2025 21:52:47 +0000 (23:52 +0200)
committerLaszlo Boszormenyi (GCS) <gcs@debian.org>
Mon, 19 May 2025 18:39:08 +0000 (20:39 +0200)
there are too many issues with conn->want and conn->want_ext
conversion, for now just log a warning, but setting both
flags is now not fatal anymore.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Gbp-Pq: Name Make_conn-want-want_ext_conversion_non_fatal.patch

lib/fuse.c
lib/fuse_i.h
lib/fuse_lowlevel.c

index 49f57112a1073e0a92403b3cda6fb9cacc445dc9..c0d00edbc463e6f8c1cd872f663d6b05395ffbb8 100644 (file)
@@ -2618,25 +2618,11 @@ void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn,
        if (fs->op.init) {
                uint64_t want_ext_default = conn->want_ext;
                uint32_t want_default = fuse_lower_32_bits(conn->want_ext);
-               int rc;
 
                conn->want = want_default;
                fs->user_data = fs->op.init(conn, cfg);
 
-               rc = convert_to_conn_want_ext(conn, want_ext_default,
-                                             want_default);
-
-               if (rc != 0) {
-                       /*
-                        * This is a grave developer error, but
-                        * we cannot return an error here, as the function
-                        * signature does not allow it.
-                        */
-                       fuse_log(
-                               FUSE_LOG_ERR,
-                               "fuse: Aborting due to invalid conn want flags.\n");
-                       _exit(EXIT_FAILURE);
-               }
+               convert_to_conn_want_ext(conn, want_ext_default, want_default);
        }
 }
 
index 48b8294f3920d1c489d54579b8bc1d1976359f85..bf5e2ca414f2cb921ca16d1e82421bac3d3a39ae 100644 (file)
@@ -245,11 +245,8 @@ static inline int convert_to_conn_want_ext(struct fuse_conn_info *conn,
         */
        if (conn->want != want_default &&
            fuse_lower_32_bits(conn->want_ext) != conn->want) {
-               if (conn->want_ext != want_ext_default) {
-                       fuse_log(FUSE_LOG_ERR,
-                                "fuse: both 'want' and 'want_ext' are set\n");
+               if (conn->want_ext != want_ext_default)
                        return -EINVAL;
-               }
 
                /* high bits from want_ext, low bits from want */
                conn->want_ext = fuse_higher_32_bits(conn->want_ext) |
index 9ebaaf08ee23b8eff214db8f45ffc5d1426b6dbe..9ee88b16063aa9872289a3d1003b7f1b4c310008 100644 (file)
@@ -2160,7 +2160,6 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
        if (se->op.init) {
                uint64_t want_ext_default = se->conn.want_ext;
                uint32_t want_default = fuse_lower_32_bits(se->conn.want_ext);
-               int rc;
 
                // Apply the first 32 bits of capable_ext to capable
                se->conn.capable = fuse_lower_32_bits(se->conn.capable_ext);
@@ -2173,14 +2172,8 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
                 * se->conn.want_ext
                 * Userspace might still use conn.want - we need to convert it
                 */
-               rc = convert_to_conn_want_ext(&se->conn, want_ext_default,
+               convert_to_conn_want_ext(&se->conn, want_ext_default,
                                              want_default);
-               if (rc != 0) {
-                       fuse_reply_err(req, EPROTO);
-                       se->error = -EPROTO;
-                       fuse_session_exit(se);
-                       return;
-               }
        }
 
        if (!want_flags_valid(se->conn.capable_ext, se->conn.want_ext)) {