提交 35fd3dc5 编写于 作者: L Linus Torvalds

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

Pull Ceph fixes form Sage Weil:
 "There are two fixes in the messenger code, one that can trigger a NULL
  dereference, and one that error in refcounting (extra put).  There is
  also a trivial fix that in the fs client code that is triggered by NFS
  reexport."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: fix dentry reference leak in encode_fh()
  libceph: avoid NULL kref_put when osd reset races with alloc_msg
  rbd: reset BACKOFF if unable to re-queue
...@@ -90,6 +90,8 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len, ...@@ -90,6 +90,8 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
*max_len = handle_length; *max_len = handle_length;
type = 255; type = 255;
} }
if (dentry)
dput(dentry);
return type; return type;
} }
......
...@@ -2300,10 +2300,11 @@ static void con_work(struct work_struct *work) ...@@ -2300,10 +2300,11 @@ static void con_work(struct work_struct *work)
mutex_unlock(&con->mutex); mutex_unlock(&con->mutex);
return; return;
} else { } else {
con->ops->put(con);
dout("con_work %p FAILED to back off %lu\n", con, dout("con_work %p FAILED to back off %lu\n", con,
con->delay); con->delay);
set_bit(CON_FLAG_BACKOFF, &con->flags);
} }
goto done;
} }
if (con->state == CON_STATE_STANDBY) { if (con->state == CON_STATE_STANDBY) {
...@@ -2749,6 +2750,7 @@ static int ceph_con_in_msg_alloc(struct ceph_connection *con, int *skip) ...@@ -2749,6 +2750,7 @@ static int ceph_con_in_msg_alloc(struct ceph_connection *con, int *skip)
msg = con->ops->alloc_msg(con, hdr, skip); msg = con->ops->alloc_msg(con, hdr, skip);
mutex_lock(&con->mutex); mutex_lock(&con->mutex);
if (con->state != CON_STATE_OPEN) { if (con->state != CON_STATE_OPEN) {
if (msg)
ceph_msg_put(msg); ceph_msg_put(msg);
return -EAGAIN; return -EAGAIN;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册