The commit is pushed to "branch-rh7-3.10.0-693.17.1.vz7.45.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.17.1.vz7.43.7
------>
commit 40f49c93b1e1db2b4a1479fa6fc3aed49cd7b97c
Author: Dmitry Monakhov <dmonak...@openvz.org>
Date:   Mon Feb 19 14:02:59 2018 +0300

    fuse: assert i_size boundaries for fuse_direct_IO_bvec
    
    Current implementation of fuse_direct_IO_bvec has not support
    to extend i_size, and this fact is silently ignored.
    Let's add explicit BUG_ON here.
    
    https://jira.sw.ru/browse/PSBM-80680
    Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org>
---
 fs/fuse/file.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index d2911703051f..fe7e9d00ae8e 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -3447,8 +3447,12 @@ static ssize_t fuse_direct_IO_bvec(int rw, struct kiocb 
*iocb,
        size_t nmax = (rw == WRITE ? fc->max_write : fc->max_read);
        size_t filled, nres;
        loff_t pos = iocb->ki_pos;
+       loff_t i_size = i_size_read(file->f_mapping->host);
        int i;
 
+       /* TODO: File extension is not yet implemented */
+       BUG_ON(offset + bvec_length(bvec, bvec_len) > i_size);
+
        if (nmax > FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT)
                nmax = FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT;
 
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to