.. | .. |
---|
647 | 647 | capsnap->size); |
---|
648 | 648 | |
---|
649 | 649 | spin_lock(&mdsc->snap_flush_lock); |
---|
650 | | - if (list_empty(&ci->i_snap_flush_item)) |
---|
| 650 | + if (list_empty(&ci->i_snap_flush_item)) { |
---|
| 651 | + ihold(inode); |
---|
651 | 652 | list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); |
---|
| 653 | + } |
---|
652 | 654 | spin_unlock(&mdsc->snap_flush_lock); |
---|
653 | 655 | return 1; /* caller may want to ceph_flush_snaps */ |
---|
654 | 656 | } |
---|
.. | .. |
---|
1008 | 1010 | continue; |
---|
1009 | 1011 | adjust_snap_realm_parent(mdsc, child, realm->ino); |
---|
1010 | 1012 | } |
---|
| 1013 | + } else { |
---|
| 1014 | + /* |
---|
| 1015 | + * In the non-split case both 'num_split_inos' and |
---|
| 1016 | + * 'num_split_realms' should be 0, making this a no-op. |
---|
| 1017 | + * However the MDS happens to populate 'split_realms' list |
---|
| 1018 | + * in one of the UPDATE op cases by mistake. |
---|
| 1019 | + * |
---|
| 1020 | + * Skip both lists just in case to ensure that 'p' is |
---|
| 1021 | + * positioned at the start of realm info, as expected by |
---|
| 1022 | + * ceph_update_snap_trace(). |
---|
| 1023 | + */ |
---|
| 1024 | + p += sizeof(u64) * num_split_inos; |
---|
| 1025 | + p += sizeof(u64) * num_split_realms; |
---|
1011 | 1026 | } |
---|
1012 | 1027 | |
---|
1013 | 1028 | /* |
---|