HAMMER VFS - Fix assertion when taking snapshot
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 2 Feb 2010 17:51:00 +0000 (09:51 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 2 Feb 2010 17:51:00 +0000 (09:51 -0800)
commit60c46a8fae7ccb73c1185d3d9e28f01cb8fca33f
tree6f2430e834063a35090692203b448ea644b25ed2
parentf81efabe6cfad69749e4ae640494ad2652b49dbf
HAMMER VFS - Fix assertion when taking snapshot

* hammer_ioc_add_snapshot() issues an ASOF lookup for the snapshot and
  then a non-ASOF insertion (insertions never use ASOF).  However, the
  ASOF lookup can modify the cursor's key (cursor.key_beg).

  This mismatch between the cursor's key and the leaf being inserted can
  then result in an assertion in the btree insertion code.

* Reloading the key before doing the insertion fixes the problem.  Also
  document the case.

Reported-by: Stathis Kamperis <ekamperi@gmail.com>
sys/vfs/hammer/hammer_ioctl.c