aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/snap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r--fs/ceph/snap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index bf2a5f3846a4..e6f9bc57d472 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -1,6 +1,7 @@
1#include "ceph_debug.h" 1#include "ceph_debug.h"
2 2
3#include <linux/sort.h> 3#include <linux/sort.h>
4#include <linux/slab.h>
4 5
5#include "super.h" 6#include "super.h"
6#include "decode.h" 7#include "decode.h"
@@ -314,9 +315,9 @@ static int build_snap_context(struct ceph_snap_realm *realm)
314 because we rebuild_snap_realms() works _downward_ in 315 because we rebuild_snap_realms() works _downward_ in
315 hierarchy after each update.) */ 316 hierarchy after each update.) */
316 if (realm->cached_context && 317 if (realm->cached_context &&
317 realm->cached_context->seq <= realm->seq && 318 realm->cached_context->seq == realm->seq &&
318 (!parent || 319 (!parent ||
319 realm->cached_context->seq <= parent->cached_context->seq)) { 320 realm->cached_context->seq >= parent->cached_context->seq)) {
320 dout("build_snap_context %llx %p: %p seq %lld (%d snaps)" 321 dout("build_snap_context %llx %p: %p seq %lld (%d snaps)"
321 " (unchanged)\n", 322 " (unchanged)\n",
322 realm->ino, realm, realm->cached_context, 323 realm->ino, realm, realm->cached_context,
@@ -818,7 +819,9 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
818 * queued (again) by ceph_update_snap_trace() 819 * queued (again) by ceph_update_snap_trace()
819 * below. Queue it _now_, under the old context. 820 * below. Queue it _now_, under the old context.
820 */ 821 */
822 spin_lock(&realm->inodes_with_caps_lock);
821 list_del_init(&ci->i_snap_realm_item); 823 list_del_init(&ci->i_snap_realm_item);
824 spin_unlock(&realm->inodes_with_caps_lock);
822 spin_unlock(&inode->i_lock); 825 spin_unlock(&inode->i_lock);
823 826
824 ceph_queue_cap_snap(ci, 827 ceph_queue_cap_snap(ci,