Now that pages from a killed request are no longer released, it's safe
to write to these pages which though will be discarded later. However
It makes the code simpler and cleaner without having to treat killed
requests speciallly.

Related to #VSTOR-101450
Signed-off-by: Liu Kui <kui....@virtuozzo.com>
---
 fs/fuse/dev.c              | 18 +-----------------
 fs/fuse/kio/pcs/pcs_krpc.c |  2 +-
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 99bb359cf4ad..5f19af552cb5 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1979,11 +1979,6 @@ static int copy_out_args(struct fuse_copy_state *cs, 
struct fuse_args *args,
 {
        unsigned reqsize = sizeof(struct fuse_out_header);
 
-       if (unlikely(args->killed)) {
-               cs->req->out.h.error = -EIO;
-               return 0;
-       }
-
        reqsize += fuse_len_args(args->out_numargs, args->out_args);
 
        if (reqsize < nbytes || (reqsize > nbytes && !args->out_argvar))
@@ -2079,9 +2074,6 @@ static int copy_out_splices(struct fuse_copy_state *cs, 
struct fuse_args *args,
                                int ioff = pipe->bufs[tail & mask].offset;
                                int ilen = pipe->bufs[tail & mask].len;
 
-                               if (unlikely(args->killed))
-                                       goto skip_copy;
-
                                while (ilen > 0) {
                                        int copy = ilen;
 
@@ -2106,7 +2098,6 @@ static int copy_out_splices(struct fuse_copy_state *cs, 
struct fuse_args *args,
                                        ioff += copy;
                                        ilen -= copy;
                                }
-skip_copy:
                                put_page(ipage);
                                pipe->bufs[tail & mask].ops = NULL;
                                pipe->bufs[tail & mask].page = NULL;
@@ -2121,9 +2112,7 @@ static int copy_out_splices(struct fuse_copy_state *cs, 
struct fuse_args *args,
                }
        }
 
-       if (unlikely(args->killed)) {
-               cs->req->out.h.error = -EIO;
-       } else if (args->page_zeroing && didx < ap->num_pages) {
+       if (args->page_zeroing && didx < ap->num_pages) {
                if (doff < dend) {
                        void *dst = kmap_atomic(dpage);
 
@@ -2163,11 +2152,6 @@ static int copy_out_krpczc(struct fuse_copy_state *cs, 
struct fuse_args *args,
        void *dst;
        int err;
 
-       if (unlikely(args->killed)) {
-               cs->req->out.h.error = -EIO;
-               return 0;
-       }
-
        if (args->out_numargs != 1 || !args->out_pages)
                return -EINVAL;
 
diff --git a/fs/fuse/kio/pcs/pcs_krpc.c b/fs/fuse/kio/pcs/pcs_krpc.c
index 9cc4e12b5eab..0b47afb9bb01 100644
--- a/fs/fuse/kio/pcs/pcs_krpc.c
+++ b/fs/fuse/kio/pcs/pcs_krpc.c
@@ -562,7 +562,7 @@ static int kreq_make_sendmsg(struct krpc_req *kreq)
                        chunk->type = KRPC_CHUNK_TYPE_ZC;
                        chunk->addr = chunk_bdzc->offset;
                        chunk->req = fuse_dev_find_request(chunk_bdzc->devfd, 
chunk_bdzc->unique);
-                       if (!chunk->req || chunk->req->args->killed) {
+                       if (!chunk->req) {
                                res = PCS_ERR_INV_PARAMS;
                                goto err_free_data_chunk;
                        }
-- 
2.39.5 (Apple Git-154)

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to