]> Pileus Git - ~andy/linux/commitdiff
fuse: rcu-delay freeing fuse_conn
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 4 Oct 2013 01:21:39 +0000 (21:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Oct 2013 03:45:13 +0000 (23:45 -0400)
makes ->permission() and ->d_revalidate() safety in RCU mode independent
from vfsmount_lock.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/cuse.c
fs/fuse/fuse_i.h
fs/fuse/inode.c

index adbfd66b380f6bbc3d275234851746ba0c33c6d4..8ca88d716dd39a82dfa0a5a6168066bce91cb935 100644 (file)
@@ -473,7 +473,7 @@ err:
 static void cuse_fc_release(struct fuse_conn *fc)
 {
        struct cuse_conn *cc = fc_to_cc(fc);
-       kfree(cc);
+       kfree_rcu(cc, fc.rcu);
 }
 
 /**
index fe446c222e3f618eadf0d7b1dc28933286917807..4715674f050c65e1c845f86952d66087cd72890f 100644 (file)
@@ -377,6 +377,8 @@ struct fuse_conn {
        /** Refcount */
        atomic_t count;
 
+       struct rcu_head rcu;
+
        /** The user id for this mount */
        kuid_t user_id;
 
index 1c15613c64f8d0e768596a2e35ee81f3d486d7cc..d468643a68b2f4b9b9cf7ca38de529db096f89ed 100644 (file)
@@ -918,7 +918,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
 
 static void fuse_free_conn(struct fuse_conn *fc)
 {
-       kfree(fc);
+       kfree_rcu(fc, rcu);
 }
 
 static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb)