[Devel] [PATCH RHEL7 COMMIT] fs/fuse: fix mutually exclusive flags in fuse_send_unmap()

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 9 12:18:58 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.4
------>
commit 0bd65d2c720cf1522b8f874a5fbece4b8b364291
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Tue Oct 9 12:18:58 2018 +0300

    fs/fuse: fix mutually exclusive flags in fuse_send_unmap()
    
    Combination of flags FALLOC_FL_PUNCH_HOLE | FALLOC_FL_ZERO_RANGE to falloc looks
    very strange and these flags are mutually exclusive. For the operation of unmap
    need only FALLOC_FL_PUNCH_HOLE flag.
    
    Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    Fuse: Fix IOCB_CMD_UNMAP_ITER handling to prevent cache inconsistency
    
    https://pmc.acronis.com/browse/VSTOR-15447
    
    Ploop can asynchronously unmap regions by sending IOCB_CMD_UNMAP_ITER, but this
    command isn't quite correctly interpreted in Fuse. Moreover, in Fast-path mode,
    fallocate(FALLOC_FL_PUNCH_HOLE|FALLOC_FL_ZERO_RANGE) falls to fuse user daemon
    and it can lead to data corruption.
    
    Let's fix it.
    
    Pavel Butsykin (4):
      fs/fuse: fix mutually exclusive flags in fuse_send_unmap()
      fs/fuse: initialize req->io_inode in fuse_send_unmap()
      fs/fuse kio_pcs: split kpcs_req_send()
      fs/fuse kio_pcs: prevention of falling kio reqs to usermode
---
 fs/fuse/file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 8611283f7a9a..0d061732dfa5 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1343,9 +1343,7 @@ static size_t fuse_send_unmap(struct fuse_req *req, struct fuse_io_priv *io,
 	inarg->fh = ff->fh;
 	inarg->offset = pos;
 	inarg->length = count;
-	inarg->mode = FALLOC_FL_KEEP_SIZE |
-		      FALLOC_FL_PUNCH_HOLE |
-		      FALLOC_FL_ZERO_RANGE;
+	inarg->mode = FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE;
 	req->in.h.opcode = FUSE_FALLOCATE;
 	req->in.h.nodeid = ff->nodeid;
 	req->in.numargs = 1;


More information about the Devel mailing list