hammer streaming seems stop working for a while

Tomohiro Kusumi kusumi.tomohiro at gmail.com
Tue Feb 23 09:44:27 PST 2016


Something like this should work, but code gets complicated (for what it's
trying to do).

I really think this check should exist not only in userspace command
runtime but also in kernel space,
given the assumption that the hammer's kernel code makes,
but I'll see if I can make it look any better.


diff --git a/sys/vfs/hammer/hammer_pfs.c b/sys/vfs/hammer/hammer_pfs.c
index 917a9c9..6bbe273 100644
--- a/sys/vfs/hammer/hammer_pfs.c
+++ b/sys/vfs/hammer/hammer_pfs.c
@@ -130,11 +130,19 @@ hammer_ioc_set_pseudofs(hammer_transaction_t trans,
hammer_inode_t ip,
                 */
                if (error == 0 &&
                    (pfsm->pfsd.mirror_flags & HAMMER_PFSD_SLAVE) == 0) {
+                       if (lo_to_pfs(ip->obj_localization) !=
HAMMER_ROOT_PFSID) {
+                               hmkprintf(trans->hmp,
+                                       "Creating a PFS from non-root PFS
is "
+                                       "not allowed\n");
+                               error = EINVAL;
+                               goto end;
+                       }
                        error = hammer_mkroot_pseudofs(trans, cred, pfsm);
                }
                if (error == 0)
                        error = hammer_save_pseudofs(trans, pfsm);

+end:
                /*
                 * Wakeup anyone waiting for a TID update for this PFS
                 */


2016-02-23 23:04 GMT+09:00 Tomohiro Kusumi <kusumi.tomohiro at gmail.com>:

> Sorry, I reverted
>
> https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8a94c3ebc13420d2c3d35360eff649e2308b7d9c
>
>
> There was one case where mirror write calls this ioctl (not to create a
> PFS),
> and this sanity check I reverted wasn't appropriate for this particular
> case.
>
> (I'm now wondering why no one has complained this for more than 2 months.
> I will check some more details of this mirror write case that caused this
> issue)
>
> # grep SET_PSEUDOFS sbin/hammer -rI
> sbin/hammer/cmd_pfs.c:  if (ioctl(fd, HAMMERIOC_SET_PSEUDOFS, &pfs) < 0) {
> sbin/hammer/cmd_pfs.c:  if (ioctl(fd, HAMMERIOC_SET_PSEUDOFS, &pfs) < 0) {
> sbin/hammer/cmd_pfs.c:          if (ioctl(fd, HAMMERIOC_SET_PSEUDOFS,
> &pfs) < 0) {
> sbin/hammer/cmd_pfs.c:          if (ioctl(fd, HAMMERIOC_SET_PSEUDOFS,
> &pfs) == 0) {
> sbin/hammer/cmd_mirror.c:               if (ioctl(fd,
> HAMMERIOC_SET_PSEUDOFS, &pfs) != 0) {
>
>
> 2016-02-23 22:11 GMT+09:00 Sepherosa Ziehau <sepherosa at gmail.com>:
>
>> Hi all,
>>
>> I just noticed today, my hammer back mechanism seems stop working for a
>> while.
>>
>> The output of mount on the backup machine:
>> ROOT on / (hammer, local, noatime)
>> devfs on /dev (devfs, local)
>> /dev/serno/3PT023B3.s1a on /boot (ufs, local, noatime)
>> REPOS on /repos (hammer, local, noatime)
>> /repos/pfs/@@-1:00007 on /var (null, local)
>> /repos/pfs/@@-1:00003 on /tmp (null, local)
>> /repos/pfs/@@-1:00006 on /usr (null, local)
>> /repos/pfs/@@-1:00001 on /usr/obj (null, local)
>> /repos/pfs/@@-1:00005 on /var/crash (null, local)
>> /repos/pfs/@@-1:00004 on /var/tmp (null, local)
>> /repos/pfs/@@-1:00002 on /usr/src (null, local)
>> /repos/pfs/@@0x00000004f3766630:00009 on /backup/sephe/home (null,
>> local, read-only)
>> /repos/pfs/@@0x00000004f3766630:00008 on /backup/sephe/opt (null,
>> local, read-only)
>> /repos/pfs/@@-1:00010 on /backup/cold (null, local)
>> procfs on /proc (procfs, local)
>>
>> /backup/sephe/home and /backup/sephe/opt is the slave.
>>
>> On my laptop, I run:
>> hammer mirror-stream /opt root at enigma:/backup/sephe/opt
>> hammer mirror-stream /home root at enigma:/backup/sephe/home
>>
>> And on the backup machine, I got many:
>> HAMMER(REPOS) Creating a PFS from non-root PFS is not allowed
>> in dmesg
>>
>> It seems the above line is logged each time, the hammer mirror-stream
>> runs on my laptop.
>>
>> I don't know when it started.
>>
>> Thanks,
>> sephe
>>
>> --
>> Tomorrow Will Never Die
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20160224/68ca0fa9/attachment-0003.htm>


More information about the Users mailing list