linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: "Maciej Zięba" <maciekz82@gmail.com>,
	"Miklos Szeredi" <miklos@szeredi.hu>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"Theodore Tso" <tytso@mit.edu>,
	"Mark Salyzyn" <salyzyn@android.com>
Subject: Re: overlayfs 4.19: unable to make backup link: Invalid cross-device link
Date: Wed, 14 Nov 2018 09:25:41 -0500	[thread overview]
Message-ID: <20181114142541.GB29804@redhat.com> (raw)
In-Reply-To: <CAOQ4uxjRGpwGou3+BNUvMV6bCx8ysTyEESOR9RVY4Nc2QvkJjg@mail.gmail.com>

On Wed, Nov 14, 2018 at 02:09:01PM +0200, Amir Goldstein wrote:

[..]
> Vivek, Mark,
> 
> Either of you care to implement dropping privileges for the duration
> of unionmount-testsuite test cases (in between mounts and unmounts)?

Hi Amir,

I think it will be good to drop priviliges while running
unionmount-testsuite.

BTW, docker build used to run as root/priviliged user. Is that not the case
anymore? Why did it fail to begin with.

Thanks
Vivek

> 
> Thanks,
> Amir.
> 
> ---
> 
> diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
> index c6289147c787..82c129bfe58d 100644
> --- a/fs/overlayfs/dir.c
> +++ b/fs/overlayfs/dir.c
> @@ -651,6 +651,18 @@ static int ovl_symlink(struct inode *dir, struct
> dentry *dentry,
>         return ovl_create_object(dentry, S_IFLNK, 0, link);
>  }
> 
> +static int ovl_set_link_redirect(struct dentry *dentry)
> +{
> +       const struct cred *old_cred;
> +       int err;
> +
> +       old_cred = ovl_override_creds(dentry->d_sb);
> +       err = ovl_set_redirect(dentry, false);
> +       revert_creds(old_cred);
> +
> +       return err;
> +}
> +
>  static int ovl_link(struct dentry *old, struct inode *newdir,
>                     struct dentry *new)
>  {
> @@ -670,7 +682,7 @@ static int ovl_link(struct dentry *old, struct
> inode *newdir,
>                 goto out_drop_write;
> 
>         if (ovl_is_metacopy_dentry(old)) {
> -               err = ovl_set_redirect(old, false);
> +               err = ovl_set_link_redirect(old);
>                 if (err)
>                         goto out_drop_write;
>         }

      reply	other threads:[~2018-11-15  0:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27 20:04 overlayfs 4.19: unable to make backup link: Invalid cross-device link Theodore Y. Ts'o
2018-10-29  7:37 ` Amir Goldstein
2018-10-29  8:31 ` Miklos Szeredi
2018-10-29 22:04   ` Theodore Y. Ts'o
2018-10-30  4:44     ` Amir Goldstein
2018-11-14  9:46       ` Amir Goldstein
2018-11-14  9:55         ` Miklos Szeredi
     [not found]           ` <CACTyJpCx7y-5OOhk0P8ETQwp4_n-a1W1Dmc-1dHeE6j_cvdk7A@mail.gmail.com>
2018-11-14 12:09             ` Amir Goldstein
2018-11-14 14:25               ` Vivek Goyal [this message]

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=20181114142541.GB29804@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=maciekz82@gmail.com \
    --cc=miklos@szeredi.hu \
    --cc=salyzyn@android.com \
    --cc=tytso@mit.edu \
    /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).