Merge 4.14.53 into android-4.14
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / fs / fuse / dev.c
index 032485010a05ac672c13ac15340e1d0c21a38b98..f4d6c279922e205666104fa372806a45d11f8585 100644 (file)
@@ -383,8 +383,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
                if (!fc->blocked && waitqueue_active(&fc->blocked_waitq))
                        wake_up(&fc->blocked_waitq);
 
-               if (fc->num_background == fc->congestion_threshold &&
-                   fc->connected && fc->sb) {
+               if (fc->num_background == fc->congestion_threshold && fc->sb) {
                        clear_bdi_congested(fc->sb->s_bdi, BLK_RW_SYNC);
                        clear_bdi_congested(fc->sb->s_bdi, BLK_RW_ASYNC);
                }
@@ -1892,8 +1891,10 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
 
        err = copy_out_args(cs, &req->out, nbytes);
        if (req->in.h.opcode == FUSE_CANONICAL_PATH) {
-               req->out.h.error = kern_path((char *)req->out.args[0].value, 0,
-                                                       req->canonical_path);
+               char *path = (char *)req->out.args[0].value;
+
+               path[req->out.args[0].size - 1] = 0;
+               req->out.h.error = kern_path(path, 0, req->canonical_path);
        }
        fuse_copy_finish(cs);