Skip to content

Commit

Permalink
fuse: rcu-delay freeing fuse_conn
Browse files Browse the repository at this point in the history
makes ->permission() and ->d_revalidate() safety in RCU mode independent
from vfsmount_lock.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 25, 2013
1 parent 1adfcb0 commit dd3e2c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/fuse/cuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static int cuse_send_init(struct cuse_conn *cc)
static void cuse_fc_release(struct fuse_conn *fc)
{
struct cuse_conn *cc = fc_to_cc(fc);
kfree(cc);
kfree_rcu(cc, fc.rcu);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions fs/fuse/fuse_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd3e2c5

Please sign in to comment.