| .. | .. |
|---|
| 1636 | 1636 | struct inode *inode = &ci->vfs_inode; |
|---|
| 1637 | 1637 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; |
|---|
| 1638 | 1638 | struct ceph_mds_session *session = NULL; |
|---|
| 1639 | + bool need_put = false; |
|---|
| 1639 | 1640 | int mds; |
|---|
| 1640 | 1641 | |
|---|
| 1641 | 1642 | dout("ceph_flush_snaps %p\n", inode); |
|---|
| .. | .. |
|---|
| 1687 | 1688 | } |
|---|
| 1688 | 1689 | /* we flushed them all; remove this inode from the queue */ |
|---|
| 1689 | 1690 | spin_lock(&mdsc->snap_flush_lock); |
|---|
| 1691 | + if (!list_empty(&ci->i_snap_flush_item)) |
|---|
| 1692 | + need_put = true; |
|---|
| 1690 | 1693 | list_del_init(&ci->i_snap_flush_item); |
|---|
| 1691 | 1694 | spin_unlock(&mdsc->snap_flush_lock); |
|---|
| 1695 | + |
|---|
| 1696 | + if (need_put) |
|---|
| 1697 | + iput(inode); |
|---|
| 1692 | 1698 | } |
|---|
| 1693 | 1699 | |
|---|
| 1694 | 1700 | /* |
|---|
| .. | .. |
|---|
| 2957 | 2963 | |
|---|
| 2958 | 2964 | while (true) { |
|---|
| 2959 | 2965 | flags &= CEPH_FILE_MODE_MASK; |
|---|
| 2960 | | - if (atomic_read(&fi->num_locks)) |
|---|
| 2966 | + if (vfs_inode_has_locks(inode)) |
|---|
| 2961 | 2967 | flags |= CHECK_FILELOCK; |
|---|
| 2962 | 2968 | _got = 0; |
|---|
| 2963 | 2969 | ret = try_get_cap_refs(inode, need, want, endoff, |
|---|
| .. | .. |
|---|
| 3568 | 3574 | } |
|---|
| 3569 | 3575 | BUG_ON(cap->issued & ~cap->implemented); |
|---|
| 3570 | 3576 | |
|---|
| 3577 | + /* don't let check_caps skip sending a response to MDS for revoke msgs */ |
|---|
| 3578 | + if (le32_to_cpu(grant->op) == CEPH_CAP_OP_REVOKE) { |
|---|
| 3579 | + cap->mds_wanted = 0; |
|---|
| 3580 | + if (cap == ci->i_auth_cap) |
|---|
| 3581 | + check_caps = 1; /* check auth cap only */ |
|---|
| 3582 | + else |
|---|
| 3583 | + check_caps = 2; /* check all caps */ |
|---|
| 3584 | + } |
|---|
| 3585 | + |
|---|
| 3571 | 3586 | if (extra_info->inline_version > 0 && |
|---|
| 3572 | 3587 | extra_info->inline_version >= ci->i_inline_version) { |
|---|
| 3573 | 3588 | ci->i_inline_version = extra_info->inline_version; |
|---|