GNU bug report logs - #43062
--expose in vm does not reflect file modifications in guest

Previous Next

Package: guix;

Reported by: elaexuotee <at> wilsonb.com

Date: Thu, 27 Aug 2020 02:06:01 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43062 in the body.
You can then email your comments to 43062 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#43062; Package guix. (Thu, 27 Aug 2020 02:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to elaexuotee <at> wilsonb.com:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 27 Aug 2020 02:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: elaexuotee <at> wilsonb.com
To: bug-guix <at> gnu.org
Subject: --expose in vm does not reflect file modifications in guest
Date: Thu, 27 Aug 2020 11:04:47 +0900
[Message part 1 (text/plain, inline)]
## Overview

When using --expose to mirror a path between host and guest, the guest mirror
fails to reflect file modifications from the host. However, file creation and
deletion are correctly propogated.

To pick up file modifications in the guest, it is sufficient to remount
mirroring 9p filesystem.

Is this behaviour expected?


## Reproduction

The following should be sufficient to reproduce the issue:

Create a container and expose a path:

    host$ guix system --expose /some/path vm.scm
    /gnu/store/<hash>-run-vm.sh

Spin up the vm:

    host$ /gnu/store/<hash>-run-vm.sh

From the host, create a new file under /some/path, and check that the guest
sees this file:

    host$ touch /some/path/test
    guest$ cat /some/path/test
    <file is empty>

Now change the contents of this file on the host, and verify that the guest
does not see the change:

    host$ echo foo >/some/path/test
    guest$ cat /some/path/test
    <file is empty>

Finally, remount the filesystem at /some/path, and see that the guest now picks
up the changes:

    guest$ sudo mount -o remount,ro /some/path
    guest$ cat /some/path/test
    foo


## Version Information

    $ guix describe
    Generation 123	Aug 25 2020 23:19:12	(current)
      guix 253fcfe
        repository URL: https://git.savannah.gnu.org/git/guix.git
        branch: master
        commit: 253fcfe6fec8fb9d70cde8623fe562dc3ca67262

    $ cat vm.scm
    (use-modules (gnu))
    (use-service-modules networking ssh)
    (use-package-modules admin linux ncurses tmux)
    
    (operating-system
      (host-name "fmadio")
      (timezone "Asia/Tokyo")
      (locale "en_US.utf8")
    
      (bootloader (bootloader-configuration (bootloader #f) (target #f)))
      (kernel linux-libre-4.9)
      (file-systems %base-file-systems)
      (users (cons (user-account
                     (name "x")
                     (password (crypt "x" "Jr1er07l0lOUQ95GQLijow=="))
                     (group "users")
                     (supplementary-groups '("wheel")))
                   %base-user-accounts))
      (packages (cons* ncurses tcpdump tmux %base-packages))
      (services (cons* (service dhcp-client-service-type)
                       (service openssh-service-type)
                       %base-services)))


## Notes

In the above, I am running linux-libre <at> 4.9 in the guest, but another user on
#guix confirmed the issue with linux-libre <at> 5.8. The same user reported seeing
the following after modifying the host file and remounting in the guest:

    guest$ cat /some/path/test
    [   49.263620] FS-Cache: Duplicate cookie detected
    [   49.263644] FS-Cache: O-cookie c=00000000fe189610 [p=000000004224ad86 fl=226 nc=0 na=1]
    [   49.263664] FS-Cache: O-cookie d=0000000023080181 n=00000000825c3154
    [   49.263680] FS-Cache: O-key=[8] 'c3f51c0500000000'
    [   49.263695] FS-Cache: N-cookie c=00000000c11e31c7 [p=000000004224ad86 fl=2 nc=0 na=1]
    [   49.263715] FS-Cache: N-cookie d=0000000023080181 n=00000000dad562d4
    [   49.263731] FS-Cache: N-key=[8] 'c3f51c0500000000'
    foo
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#43062; Package guix. (Fri, 28 Aug 2020 14:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 43062 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 43062 <at> debbugs.gnu.org,  elaexuotee <at> wilsonb.com
Cc: Christopher Baines <mail <at> cbaines.net>
Subject: Re: bug#43062: --expose in vm does not reflect file modifications in
 guest
Date: Fri, 28 Aug 2020 16:11:26 +0200
[Message part 1 (text/plain, inline)]
Hi,

elaexuotee--- via Bug reports for GNU Guix <bug-guix <at> gnu.org> skribis:

> When using --expose to mirror a path between host and guest, the guest mirror
> fails to reflect file modifications from the host. However, file creation and
> deletion are correctly propogated.
>
> To pick up file modifications in the guest, it is sufficient to remount
> mirroring 9p filesystem.
>
> Is this behaviour expected?

I believe this comes from the “cache=loose” 9p mount option added in
commit e0d96774dd48c29ccc4c90fea1f8f71850ab0879.

Does the patch below help?

Chris, what do you think?  How would this affect the performance issues
that led to e0d96774dd48c29ccc4c90fea1f8f71850ab0879?

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 861f2a427a..80a8618729 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -699,7 +699,8 @@ of the GNU system as described by OS."
        (device (file-system->mount-tag source))
        (type "9p")
        (flags (if writable? '() '(read-only)))
-       (options "trans=virtio,cache=loose")
+       (options (string-append "trans=virtio"
+                               (if writable? "" ",cache=loose")))
        (check? #f)
        (create-mount-point? #t)))))
 

Information forwarded to bug-guix <at> gnu.org:
bug#43062; Package guix. (Sat, 29 Aug 2020 06:40:01 GMT) Full text and rfc822 format available.

Message #11 received at 43062 <at> debbugs.gnu.org (full text, mbox):

From: elaexuotee <at> wilsonb.com
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Christopher Baines <mail <at> cbaines.net>, 43062 <at> debbugs.gnu.org
Subject: Re: bug#43062: --expose in vm does not reflect file modifications in
 guest
Date: Sat, 29 Aug 2020 15:38:55 +0900
[Message part 1 (text/plain, inline)]
> I believe this comes from the “cache=loose” 9p mount option added in
> commit e0d96774dd48c29ccc4c90fea1f8f71850ab0879.
> 
> Does the patch below help?

Yes, when no caching behaviour is specified in the guest, the problem
disappears. I also tried cache=fscache and see the exact same problem as with
cache=loose.


Cheers!
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#43062; Package guix. (Sun, 30 Aug 2020 18:24:02 GMT) Full text and rfc822 format available.

Message #14 received at 43062 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: elaexuotee <at> wilsonb.com, 43062 <at> debbugs.gnu.org
Subject: Re: bug#43062: --expose in vm does not reflect file modifications in
 guest
Date: Sun, 30 Aug 2020 19:23:48 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi,
>
> elaexuotee--- via Bug reports for GNU Guix <bug-guix <at> gnu.org> skribis:
>
>> When using --expose to mirror a path between host and guest, the guest mirror
>> fails to reflect file modifications from the host. However, file creation and
>> deletion are correctly propogated.
>>
>> To pick up file modifications in the guest, it is sufficient to remount
>> mirroring 9p filesystem.
>>
>> Is this behaviour expected?
>
> I believe this comes from the “cache=loose” 9p mount option added in
> commit e0d96774dd48c29ccc4c90fea1f8f71850ab0879.
>
> Does the patch below help?
>
> Chris, what do you think?  How would this affect the performance issues
> that led to e0d96774dd48c29ccc4c90fea1f8f71850ab0879?

Caching only for readonly filesystems sounds fine, I think I was only
thinking about the store for e0d96774dd48c29ccc4c90fea1f8f71850ab0879.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 31 Aug 2020 13:53:01 GMT) Full text and rfc822 format available.

Notification sent to elaexuotee <at> wilsonb.com:
bug acknowledged by developer. (Mon, 31 Aug 2020 13:53:01 GMT) Full text and rfc822 format available.

Message #19 received at 43062-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: elaexuotee <at> wilsonb.com, 43062-done <at> debbugs.gnu.org
Subject: Re: bug#43062: --expose in vm does not reflect file modifications in
 guest
Date: Mon, 31 Aug 2020 15:52:11 +0200
Hello!

Christopher Baines <mail <at> cbaines.net> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Hi,
>>
>> elaexuotee--- via Bug reports for GNU Guix <bug-guix <at> gnu.org> skribis:
>>
>>> When using --expose to mirror a path between host and guest, the guest mirror
>>> fails to reflect file modifications from the host. However, file creation and
>>> deletion are correctly propogated.
>>>
>>> To pick up file modifications in the guest, it is sufficient to remount
>>> mirroring 9p filesystem.
>>>
>>> Is this behaviour expected?
>>
>> I believe this comes from the “cache=loose” 9p mount option added in
>> commit e0d96774dd48c29ccc4c90fea1f8f71850ab0879.
>>
>> Does the patch below help?
>>
>> Chris, what do you think?  How would this affect the performance issues
>> that led to e0d96774dd48c29ccc4c90fea1f8f71850ab0879?
>
> Caching only for readonly filesystems sounds fine, I think I was only
> thinking about the store for e0d96774dd48c29ccc4c90fea1f8f71850ab0879.

Alright, I went ahead and did that in
7eeb78157d3d0267ce4a4ea38ff56a2c4246c11b.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 29 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.