From: Al Viro Date: Fri, 4 Oct 2013 01:21:39 +0000 (-0400) Subject: fuse: rcu-delay freeing fuse_conn X-Git-Tag: v3.13-rc1~107^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd3e2c55a45fe75f3213b17b74f9a32380f4e84b;p=platform%2Fkernel%2Flinux-stable.git fuse: rcu-delay freeing fuse_conn makes ->permission() and ->d_revalidate() safety in RCU mode independent from vfsmount_lock. Signed-off-by: Al Viro --- diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index adbfd66..8ca88d7 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -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); } /** diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index fe446c2..4715674 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -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; diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 1c15613..d468643 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -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)