In the following sequence:
1) create (a, 1)
2) setattr (a, 1)
3) link (a, 1), (b, 1)
4) remove (a, 1)
If we play 1-4 and then replay 1-4 again, we will end up removing
(b, 1)'s attributes since nlink for (a, 1) the second time through
is 1. We fix this by marking spos on the object_map header for
(a, 1) when we remove (a, 1) but not eh attributes.
Signed-off-by: Samuel Just <sam.just@inktank.com>
r = object_map->clear(o, &spos);
if (r < 0 && r != -ENOENT)
return r;
+ } else {
+ /* Ensure that replay of this op doesn't result in the object_map
+ * going away.
+ */
+ if (!btrfs_stable_commits)
+ object_map->sync(&o, &spos);
}
}
return index->unlink(o);