summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mon_client.h
diff options
context:
space:
mode:
authorSage Weil2010-03-25 05:43:33 +0100
committerSage Weil2010-05-18 00:25:15 +0200
commit3143edd3a185f1fd370ebdd21b4151aa9f3283a3 (patch)
tree55253639685cc9aab6f228f780faca8dc57585aa /fs/ceph/mon_client.h
parentceph: fix theoretically possible double-put on connection (diff)
downloadkernel-qcow2-linux-3143edd3a185f1fd370ebdd21b4151aa9f3283a3.tar.gz
kernel-qcow2-linux-3143edd3a185f1fd370ebdd21b4151aa9f3283a3.tar.xz
kernel-qcow2-linux-3143edd3a185f1fd370ebdd21b4151aa9f3283a3.zip
ceph: clean up statfs
Avoid unnecessary msgpool. Preallocate reply. Fix use-after-free race. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mon_client.h')
-rw-r--r--fs/ceph/mon_client.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/mon_client.h b/fs/ceph/mon_client.h
index b958ad5afa06..cc89a86c8589 100644
--- a/fs/ceph/mon_client.h
+++ b/fs/ceph/mon_client.h
@@ -2,6 +2,7 @@
#define _FS_CEPH_MON_CLIENT_H
#include <linux/completion.h>
+#include <linux/kref.h>
#include <linux/rbtree.h>
#include "messenger.h"
@@ -44,13 +45,14 @@ struct ceph_mon_request {
* to the caller
*/
struct ceph_mon_statfs_request {
+ struct kref kref;
u64 tid;
struct rb_node node;
int result;
struct ceph_statfs *buf;
struct completion completion;
- unsigned long last_attempt, delay; /* jiffies */
struct ceph_msg *request; /* original request */
+ struct ceph_msg *reply; /* and reply */
};
struct ceph_mon_client {
@@ -72,7 +74,6 @@ struct ceph_mon_client {
/* msg pools */
struct ceph_msgpool msgpool_subscribe_ack;
- struct ceph_msgpool msgpool_statfs_reply;
struct ceph_msgpool msgpool_auth_reply;
/* pending statfs requests */