]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
fuse: Explicitly set inode ID to 1
authorHanna Czenczek <hreitz@redhat.com>
Mon, 9 Mar 2026 15:08:35 +0000 (16:08 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 10 Mar 2026 11:11:30 +0000 (12:11 +0100)
Setting .st_ino to the FUSE inode ID is kind of arbitrary.  While in
practice it is going to be fixed (to FUSE_ROOT_ID, which is 1) because
we only have the root inode, that is not obvious in fuse_getattr().

Just explicitly set it to 1 (i.e. no functional change).

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-ID: <20260309150856.26800-5-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/export/fuse.c

index 4cdf527d6912d5bdced003efb1e7bd6e2239f89d..a56f645c05d928864d7258641ea3117f4e3077a2 100644 (file)
@@ -432,7 +432,7 @@ static void fuse_getattr(fuse_req_t req, fuse_ino_t inode,
     }
 
     statbuf = (struct stat) {
-        .st_ino     = inode,
+        .st_ino     = 1,
         .st_mode    = exp->st_mode,
         .st_nlink   = 1,
         .st_uid     = exp->st_uid,