From: Vivek Goyal <vgoyal@redhat.com>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: virtio-fs@redhat.com, qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation
Date: Thu, 17 Oct 2019 11:25:22 -0400 [thread overview]
Message-ID: <20191017152522.GB12588@redhat.com> (raw)
In-Reply-To: <CAOssrKfR=sfE1RzOXzvPbdQg-g7i5-f8W9y8bWFnO=gyJ2VMsg@mail.gmail.com>
On Thu, Oct 17, 2019 at 01:23:57PM +0200, Miklos Szeredi wrote:
> On Thu, Oct 17, 2019 at 12:05 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >
> > On Wed, Oct 16, 2019 at 07:37:52PM +0900, Misono Tomohiro wrote:
> > > Hello,
> > >
> > > I test xattr operation on virtiofs using xfstest generic/062
> > > (with -o xattr option and XFS backend) and see some problems.
> > >
> > > These patches fixes the two of the problems.
> > >
> > > The remaining problems are:
> > > 1. we cannot xattr to block device created by mknod
> > > which does not have actual device (since open in virtiofsd fails)
> > > 2. we cannot xattr to symbolic link
> > >
> > > I don't think 1 is a big problem but can we fix 2?
> >
> > Sorry, I don't know the answer. Maybe it would be necessary to add a
> > new O_SYMLINK open flag to open(2) so that fgetxattr()/fsetxattr()
> > operations can be performed. A kernel change like that would take some
> > time to get accepted upstream and shipped by distros, but it might be
> > the only way since the current syscall interface doesn't seem to offer a
> > way to do this.
>
> The real problem is that open() on a non-regular, non-directory file
> may have side effects (unless O_PATH is used). These patches try to
> paper over that, but the fact is: opening special files from a file
> server is forbidden.
>
> I see why this is being done, and it's not easy to fix properly
> without the ..at() versions of these syscalls. One idea is to fork()
> + fchdir(lo->proc_self_fd) + ..xattr(). Another related idea is to do
> a unshare(CLONE_FS) after each thread's startup (will pthread library
> balk? I don't know) so that it's safe to do fchdir(lo->proc_self_fd)
> + ...xattr() + fchdir(lo->root_fd).
Hi Miklos,
Trying to understand your proposal. So if we want to do an ..xattr()
operation on a special file (and we don't have _at() variants), how
will fchdir() help. Are you suggesting fchdir() to parent and then
do something special.
Can you please elaborate your proposal a bit more. I think I have
missed the core idea completely.
I understand that you want to do unshare(CLONE_FS) to make sure one thrad's
fchdir() does not impact other thread. But did not understand that how
fchdir() alone is enough to do getxattr()/setxattr() on special file.
Thanks
Vivek
next prev parent reply other threads:[~2019-10-17 16:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 10:37 [PATCH 0/2] virtiofsd: Two fix for xattr operation Misono Tomohiro
2019-10-16 10:37 ` [PATCH 1/2] virtiofsd: Avoid process hang when doing xattr operation to FIFO Misono Tomohiro
2019-10-16 10:37 ` [PATCH 2/2] virtiofsd: Allow setxattr operation to directry Misono Tomohiro
2019-10-17 10:05 ` [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation Stefan Hajnoczi
2019-10-17 11:23 ` Miklos Szeredi
2019-10-17 13:01 ` Miklos Szeredi
2019-10-17 15:25 ` Vivek Goyal [this message]
2019-10-17 15:45 ` Miklos Szeredi
2019-10-17 16:09 ` Stefan Hajnoczi
2019-10-17 16:48 ` Miklos Szeredi
2019-10-18 7:16 ` Miklos Szeredi
2019-10-18 8:51 ` misono.tomohiro
2019-10-21 9:40 ` Stefan Hajnoczi
2019-10-23 11:42 ` misono.tomohiro
2019-10-25 12:54 ` Stefan Hajnoczi
2019-10-18 10:09 ` Stefan Hajnoczi
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=20191017152522.GB12588@redhat.com \
--to=vgoyal@redhat.com \
--cc=mszeredi@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).