Merge 4.14.53 into android-4.14
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / fs / fuse / dev.c
index 9b35551d9986254be207405388eda97282eb0dc8..f4d6c279922e205666104fa372806a45d11f8585 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/sched/signal.h>
 #include <linux/uio.h>
 #include <linux/miscdevice.h>
+#include <linux/namei.h>
 #include <linux/pagemap.h>
 #include <linux/file.h>
 #include <linux/slab.h>
@@ -382,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);
                }
@@ -1890,6 +1890,12 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
                cs->move_pages = 0;
 
        err = copy_out_args(cs, &req->out, nbytes);
+       if (req->in.h.opcode == FUSE_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);
 
        spin_lock(&fpq->lock);