All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: virtio-fs-list <virtio-fs@redhat.com>, Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [Virtio-fs] Query about announce_submounts and ro/rw mounts
Date: Thu, 4 Mar 2021 17:23:46 +0000	[thread overview]
Message-ID: <YEEXoqs4rYuyYaPs@work-vm> (raw)
In-Reply-To: <d8ddbe5e-e726-b679-8f2d-7af7db354e24@redhat.com>

* Max Reitz (mreitz@redhat.com) wrote:
> On 04.03.21 17:39, Dr. David Alan Gilbert wrote:
> > * Max Reitz (mreitz@redhat.com) wrote:
> > > On 03.03.21 19:20, Vivek Goyal wrote:
> > > > Hi Max,
> > > 
> > > Hi Vivek,
> > > 
> > > > I was playing with "announce_submounts". I have a read-only bind mounted
> > > > mount point in shared directory. Inside guest, when I step into that
> > > > directory, I see that a mount point got created but its "rw" and not "ro".
> > > > 
> > > > Is that intentional.
> > > 
> > > No, that isn’t intentional.  I just didn’t think of sharing such information
> > > with the guest.
> > > 
> > > > Can we send property of mount also to guest when
> > > > notifying guest about mount point.
> > > 
> > > I suppose we can send it (by adding a new flag alongside
> > > FUSE_ATTR_SUBMOUNT), and we can make the mount ro by setting the SB_RDONLY
> > > flag in fuse_dentry_automount().
> > > 
> > > If we implemented this for RDONLY, are there other flags that we might want
> > > to consider as well?  (e.g. nodev etc.)
> > > 
> > > OTOH, I just tested NFS, and it doesn’t pass through the RO flag:
> > > 
> > > [...]
> > > /tmp/xfs.img on ~/tmp/test-nfs/mount type xfs (ro,...)
> > > [...]
> > > 127.0.0.1:~/tmp/test-nfs on /mnt/tmp type nfs4 (rw,...)
> > > 127.0.0.1:~/tmp/test-nfs/mount on /mnt/tmp/mount type nfs4 (rw,...)
> > > 
> > > So is it really important or more a matter of style?
> > 
> > So what happens if you try and write a file in /mnt/tmp/mount ?
> 
> Well, the EROFS gets passed through from host to client:
> 
> $ LANG=C sudo touch /mnt/tmp/mount/foo
> touch: cannot touch '/mnt/tmp/mount/foo': Read-only file system
> $ mount
> [...]
> 127.0.0.1:~/tmp/test-nfs on /mnt/tmp type nfs4 (rw,...)
> 127.0.0.1:~/tmp/test-nfs/mount on /mnt/tmp/mount type nfs4 (rw,...)
> 
> (So the submount still appears rw – NFS doesn’t reevaluate when it receives
> EROFS.)

Oh OK, that's not as bad as I feared.

> 
> On virtio-fs, it’s the same:
> 
> $ LANG=C sudo touch /mnt/mnt1
> touch: cannot touch '/mnt/mnt1/foo': Read-only file system
> $ mount
> [...]
> host on /mnt type virtiofs (rw,relatime)
> none on /mnt/mnt1 type virtiofs (rw,relatime)

Good.

Dave

> Max
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


  reply	other threads:[~2021-03-04 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 18:20 [Virtio-fs] Query about announce_submounts and ro/rw mounts Vivek Goyal
2021-03-04  9:02 ` Max Reitz
2021-03-04 16:39   ` Dr. David Alan Gilbert
2021-03-04 16:58     ` Max Reitz
2021-03-04 17:23       ` Dr. David Alan Gilbert [this message]
2021-03-04 20:00   ` Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YEEXoqs4rYuyYaPs@work-vm \
    --to=dgilbert@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=vgoyal@redhat.com \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.