linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Djalal Harouni <tixxdz@gmail.com>, Chris Mason <clm@fb.com>,
	Theodore Tso <tytso@mit.edu>,
	Josh Triplett <josh@joshtriplett.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Andy Lutomirski <luto@kernel.org>,
	Seth Forshee <seth.forshee@canonical.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Dongsu Park <dongsu@endocode.com>,
	David Herrmann <dh.herrmann@googlemail.com>,
	Miklos Szeredi <mszeredi@redhat.com>,
	Alban Crequy <alban.crequy@gmail.com>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Phil Estes <estesp@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>
Subject: Re: [RFC v2 1/1] shiftfs: uid/gid shifting bind mount
Date: Thu, 2 Mar 2017 12:06:57 -0500	[thread overview]
Message-ID: <20170302170657.GI17411@redhat.com> (raw)
In-Reply-To: <1487638025.2337.49.camel@HansenPartnership.com>

On Mon, Feb 20, 2017 at 04:47:05PM -0800, James Bottomley wrote:

[..]
> +static int shiftfs_readlink(struct dentry *dentry, char __user *data,
> +			    int flags)
> +{
> +	struct dentry *real = dentry->d_fsdata;
> +	const struct inode_operations *iop = real->d_inode->i_op;
> +
> +	if (iop->readlink)
> +		return iop->readlink(real, data, flags);
> +
> +	return -EINVAL;
> +}
> +

Hi James,

I was testing shiftfs on top of xfs and noticed readlink() is failing as
xfs does not define readlink. 

Following patch fixes it for me.

Vivek

---
 fs/shiftfs.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Index: rhvgoyal-linux/fs/shiftfs.c
===================================================================
--- rhvgoyal-linux.orig/fs/shiftfs.c	2017-02-28 11:07:04.360579594 -0500
+++ rhvgoyal-linux/fs/shiftfs.c	2017-03-02 11:59:17.484345405 -0500
@@ -179,12 +179,8 @@ static int shiftfs_readlink(struct dentr
 			    int flags)
 {
 	struct dentry *real = dentry->d_fsdata;
-	const struct inode_operations *iop = real->d_inode->i_op;
 
-	if (iop->readlink)
-		return iop->readlink(real, data, flags);
-
-	return -EINVAL;
+	return vfs_readlink(real, data, flags);
 }
 
 static const char *shiftfs_get_link(struct dentry *dentry, struct inode *inode,

      parent reply	other threads:[~2017-03-02 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  0:45 [RFC v2 0/1] shiftfs: uid/gid shifting filesystem (s_user_ns version) James Bottomley
2017-02-21  0:47 ` [RFC v2 1/1] shiftfs: uid/gid shifting bind mount James Bottomley
2017-02-21 16:06   ` Vivek Goyal
2017-02-21 22:23     ` James Bottomley
2017-02-22 16:41       ` Vivek Goyal
2017-03-02 17:06   ` 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=20170302170657.GI17411@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alban.crequy@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=clm@fb.com \
    --cc=dh.herrmann@googlemail.com \
    --cc=dongsu@endocode.com \
    --cc=ebiederm@xmission.com \
    --cc=estesp@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=serge@hallyn.com \
    --cc=seth.forshee@canonical.com \
    --cc=tixxdz@gmail.com \
    --cc=tytso@mit.edu \
    --cc=viro@ZenIV.linux.org.uk \
    /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).