diff options
-rw-r--r-- | fs/ceph/file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 7d0e4a82d898..db5d86309744 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -568,7 +568,14 @@ more: | |||
568 | spin_unlock(&ci->i_unsafe_lock); | 568 | spin_unlock(&ci->i_unsafe_lock); |
569 | ceph_get_cap_refs(ci, CEPH_CAP_FILE_WR); | 569 | ceph_get_cap_refs(ci, CEPH_CAP_FILE_WR); |
570 | } | 570 | } |
571 | |||
571 | ret = ceph_osdc_wait_request(&fsc->client->osdc, req); | 572 | ret = ceph_osdc_wait_request(&fsc->client->osdc, req); |
573 | if (ret < 0 && req->r_safe_callback) { | ||
574 | spin_lock(&ci->i_unsafe_lock); | ||
575 | list_del_init(&req->r_unsafe_item); | ||
576 | spin_unlock(&ci->i_unsafe_lock); | ||
577 | ceph_put_cap_refs(ci, CEPH_CAP_FILE_WR); | ||
578 | } | ||
572 | } | 579 | } |
573 | 580 | ||
574 | if (file->f_flags & O_DIRECT) | 581 | if (file->f_flags & O_DIRECT) |