[DragonFlyBSD - Bug #2863] HAMMER synch tid is zero

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Sat Dec 12 22:21:50 PST 2015


Issue #2863 has been updated by dillon.


Well, my first thought before looking at the patch was that the initial conditions for hmp->flusher.tid needed to be initialized so a retrieval prior to any actual flush returns a reasonable TID.

The patch appears to do that, but I agree that it probably should not allocate a new TID.  We should be able to initialize flusher.tid from the on-disk volume structure.  The alloctid code is calculating from hmp->next_tid.  hmp->next_tid is initialized from the root volume structure:

hmp->next_tid = rootvol->ondisk->vol0_next_tid;

So it should be possible to just do an initial assignment of flusher.tid to hmp->next_tid.  If that doesn't work (if hmp->next_tid is not yet initialized at that point, but I think is)... then it could be pulled from rootvol->vol0_next_tid using this sequence:

volume = hammer_get_root_volume(hmp, &error);
hmp->flusher.tid = volume->ondisk->vol0_next_tid;
hammer_rel_volume(volume, 0);

That would prevent the ioctl from improperly returning a TID of 0.  A TID of 0 definitely should never be returned by that ioctl.

-Matt

----------------------------------------
Bug #2863: HAMMER synch tid is zero
http://bugs.dragonflybsd.org/issues/2863#change-12782

* Author: shamaz
* Status: New
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Hello. This appears on DragonFlyBSD 4.2 (and maybe newer) if you try the
following with HAMMER filesystem:

1) Create a new vnode device.
# dd if=/dev/zero of=test.img bs=1m count=15000
# vnconfig -c vn test.img
# disklabel64  -w -r vn4s0 auto
# disklabel64 -e vn4s0
Add a line like "a:      *      0     HAMMER"

2) Create a HAMMER filesystem:
newfs_hammer -f -L TEST /dev/vn4s0a

3) Mount it:
mount /dev/vn4s0a /mnt

4) Try to sync it:
hammer synctid /mnt

You will see zero sync tid (0x0000000000000000). If you try to set some
debug-related sysctls, it will get you no info at all when syncing. Also
hammer pfs-status /mnt will show that sync-end-tid does not increment in
time as it should. I am not sure if it happens with any non-root hammer FS,
or just with those based on vn pseudo disks.

---Files--------------------------------
flusher_tid.patch (492 Bytes)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list