OSDN Git Service

block/export/fuse.c: allow writable exports to take RESIZE permission
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Thu, 3 Mar 2022 15:15:51 +0000 (10:15 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Mar 2022 17:18:25 +0000 (18:18 +0100)
commit8cc5882c7fe0759f856b2f97a08816353227e8f7
tree3000c18a5fa451d104a1f69c29ff9cfd97cf63f8
parent384a48fb7423dfb303023eb504e1fc5e6acb4de4
block/export/fuse.c: allow writable exports to take RESIZE permission

Allow writable exports to get BLK_PERM_RESIZE permission
from creation, in fuse_export_create().
In this way, there is no need to give the permission in
fuse_do_truncate(), which might be run in an iothread.

Permissions should be set only in the main thread, so
in any case if an iothread tries to set RESIZE, it will
be blocked.

Also assert in fuse_do_truncate that if we give the
RESIZE permission we can then restore the original ones.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303151616.325444-7-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/export/fuse.c