Commit c292fe4a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  libceph: Allocate larger oid buffer in request msgs
  ceph: initialize root dentry
  ceph: fix iput race when queueing inode work
parents 7758c4d6 224736d9
...@@ -1143,7 +1143,7 @@ static void ceph_d_prune(struct dentry *dentry) ...@@ -1143,7 +1143,7 @@ static void ceph_d_prune(struct dentry *dentry)
{ {
struct ceph_dentry_info *di; struct ceph_dentry_info *di;
dout("d_release %p\n", dentry); dout("ceph_d_prune %p\n", dentry);
/* do we have a valid parent? */ /* do we have a valid parent? */
if (!dentry->d_parent || IS_ROOT(dentry)) if (!dentry->d_parent || IS_ROOT(dentry))
......
...@@ -1328,12 +1328,13 @@ int ceph_inode_set_size(struct inode *inode, loff_t size) ...@@ -1328,12 +1328,13 @@ int ceph_inode_set_size(struct inode *inode, loff_t size)
*/ */
void ceph_queue_writeback(struct inode *inode) void ceph_queue_writeback(struct inode *inode)
{ {
ihold(inode);
if (queue_work(ceph_inode_to_client(inode)->wb_wq, if (queue_work(ceph_inode_to_client(inode)->wb_wq,
&ceph_inode(inode)->i_wb_work)) { &ceph_inode(inode)->i_wb_work)) {
dout("ceph_queue_writeback %p\n", inode); dout("ceph_queue_writeback %p\n", inode);
ihold(inode);
} else { } else {
dout("ceph_queue_writeback %p failed\n", inode); dout("ceph_queue_writeback %p failed\n", inode);
iput(inode);
} }
} }
...@@ -1353,12 +1354,13 @@ static void ceph_writeback_work(struct work_struct *work) ...@@ -1353,12 +1354,13 @@ static void ceph_writeback_work(struct work_struct *work)
*/ */
void ceph_queue_invalidate(struct inode *inode) void ceph_queue_invalidate(struct inode *inode)
{ {
ihold(inode);
if (queue_work(ceph_inode_to_client(inode)->pg_inv_wq, if (queue_work(ceph_inode_to_client(inode)->pg_inv_wq,
&ceph_inode(inode)->i_pg_inv_work)) { &ceph_inode(inode)->i_pg_inv_work)) {
dout("ceph_queue_invalidate %p\n", inode); dout("ceph_queue_invalidate %p\n", inode);
ihold(inode);
} else { } else {
dout("ceph_queue_invalidate %p failed\n", inode); dout("ceph_queue_invalidate %p failed\n", inode);
iput(inode);
} }
} }
...@@ -1434,13 +1436,14 @@ void ceph_queue_vmtruncate(struct inode *inode) ...@@ -1434,13 +1436,14 @@ void ceph_queue_vmtruncate(struct inode *inode)
{ {
struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_inode_info *ci = ceph_inode(inode);
ihold(inode);
if (queue_work(ceph_sb_to_client(inode->i_sb)->trunc_wq, if (queue_work(ceph_sb_to_client(inode->i_sb)->trunc_wq,
&ci->i_vmtruncate_work)) { &ci->i_vmtruncate_work)) {
dout("ceph_queue_vmtruncate %p\n", inode); dout("ceph_queue_vmtruncate %p\n", inode);
ihold(inode);
} else { } else {
dout("ceph_queue_vmtruncate %p failed, pending=%d\n", dout("ceph_queue_vmtruncate %p failed, pending=%d\n",
inode, ci->i_truncate_pending); inode, ci->i_truncate_pending);
iput(inode);
} }
} }
......
...@@ -638,10 +638,12 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, ...@@ -638,10 +638,12 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
if (err == 0) { if (err == 0) {
dout("open_root_inode success\n"); dout("open_root_inode success\n");
if (ceph_ino(req->r_target_inode) == CEPH_INO_ROOT && if (ceph_ino(req->r_target_inode) == CEPH_INO_ROOT &&
fsc->sb->s_root == NULL) fsc->sb->s_root == NULL) {
root = d_alloc_root(req->r_target_inode); root = d_alloc_root(req->r_target_inode);
else ceph_init_dentry(root);
} else {
root = d_obtain_alias(req->r_target_inode); root = d_obtain_alias(req->r_target_inode);
}
req->r_target_inode = NULL; req->r_target_inode = NULL;
dout("open_root_inode success, root dentry is %p\n", root); dout("open_root_inode success, root dentry is %p\n", root);
} else { } else {
......
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
#include "osdmap.h" #include "osdmap.h"
#include "messenger.h" #include "messenger.h"
/*
* Maximum object name size
* (must be at least as big as RBD_MAX_MD_NAME_LEN -- currently 100)
*/
#define MAX_OBJ_NAME_SIZE 100
struct ceph_msg; struct ceph_msg;
struct ceph_snap_context; struct ceph_snap_context;
struct ceph_osd_request; struct ceph_osd_request;
...@@ -75,7 +81,7 @@ struct ceph_osd_request { ...@@ -75,7 +81,7 @@ struct ceph_osd_request {
struct inode *r_inode; /* for use by callbacks */ struct inode *r_inode; /* for use by callbacks */
void *r_priv; /* ditto */ void *r_priv; /* ditto */
char r_oid[40]; /* object name */ char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */
int r_oid_len; int r_oid_len;
unsigned long r_stamp; /* send OR check time */ unsigned long r_stamp; /* send OR check time */
......
...@@ -244,7 +244,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, ...@@ -244,7 +244,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
ceph_pagelist_init(req->r_trail); ceph_pagelist_init(req->r_trail);
} }
/* create request message; allow space for oid */ /* create request message; allow space for oid */
msg_size += 40; msg_size += MAX_OBJ_NAME_SIZE;
if (snapc) if (snapc)
msg_size += sizeof(u64) * snapc->num_snaps; msg_size += sizeof(u64) * snapc->num_snaps;
if (use_mempool) if (use_mempool)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment