mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
ceph: avoid iput() while holding spinlock in ceph_dir_fsync
ceph_mdsc_put_request() can call iput(), which can sleep. Don't do that. Fixes: #1812 Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
ee6b1baf67
commit
2ff179e650
1 changed files with 2 additions and 1 deletions
|
@ -1218,6 +1218,7 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
|
||||||
do {
|
do {
|
||||||
ceph_mdsc_get_request(req);
|
ceph_mdsc_get_request(req);
|
||||||
spin_unlock(&ci->i_unsafe_lock);
|
spin_unlock(&ci->i_unsafe_lock);
|
||||||
|
|
||||||
dout("dir_fsync %p wait on tid %llu (until %llu)\n",
|
dout("dir_fsync %p wait on tid %llu (until %llu)\n",
|
||||||
inode, req->r_tid, last_tid);
|
inode, req->r_tid, last_tid);
|
||||||
if (req->r_timeout) {
|
if (req->r_timeout) {
|
||||||
|
@ -1230,9 +1231,9 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
|
||||||
} else {
|
} else {
|
||||||
wait_for_completion(&req->r_safe_completion);
|
wait_for_completion(&req->r_safe_completion);
|
||||||
}
|
}
|
||||||
spin_lock(&ci->i_unsafe_lock);
|
|
||||||
ceph_mdsc_put_request(req);
|
ceph_mdsc_put_request(req);
|
||||||
|
|
||||||
|
spin_lock(&ci->i_unsafe_lock);
|
||||||
if (ret || list_empty(head))
|
if (ret || list_empty(head))
|
||||||
break;
|
break;
|
||||||
req = list_entry(head->next,
|
req = list_entry(head->next,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue