From: Al Viro <viro@ZenIV.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [GIT PULL (resend)] readlink cleanup
Date: Fri, 16 Dec 2016 23:08:23 +0000 [thread overview]
Message-ID: <20161216230823.GU1555@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20161216224859.GD27207@veci.piliscsaba.szeredi.hu>
On Fri, Dec 16, 2016 at 11:48:59PM +0100, Miklos Szeredi wrote:
> This is a rework of the readlink cleanup patchset from the last cycle. Now
> readlink(2) does the following:
>
> - if i_op->readlink() is non-NULL (only proc and afs mountpoints for now)
> then it calls that
>
> - otherwise call i_op->get_link()
>
> - signature of ->readlink() now matches that of ->get_link()
>
> In particular this last bullet point buys us:
>
> - less complexity, because we already handle the delayed free of the
> buffer and copying to userspace due to ->get_link() being the normal way
> to read the symlink
Less complexity where, exactly? In the caller the life does not become
any simpler - instead of "call ->readlink() and bugger off" you have
"call ->readlink() and go through the same motions as in ->get_link()-based
case". In the instances it becomes _more_ complex.
What's more, this new signature for ->readlink() makes no sense - instead of
"symlink traversal does not involve resolving a pathname, so we have to
fake one for readlink(2)" you get something resembling ->get_link(), which
would _not_ function as ->get_link() ought to. But it can be called by the
same codepath that calls ->get_link(), saving us the burden of returning
without doing what ->get_link-based case would - we still get to check if
->readlink() is there, but we rejoin the common path immediately. And AFAICS
that's the _only_ benefit of that signature change - making it possible to
reuse a few lines that adapt ->get_link() to readlinkat(2) needs.
IOW, I'm still not convinced. Beginning of the series is fine - having
NULL ->readlink() interpreted for symlinks as "no override, use
generic_readlink()" makes a lot of sense. This part, IMO, does not.
next prev parent reply other threads:[~2016-12-16 23:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 22:48 [GIT PULL (resend)] readlink cleanup Miklos Szeredi
2016-12-16 23:08 ` Al Viro [this message]
2016-12-17 8:49 ` Miklos Szeredi
2016-12-18 3:21 ` Linus Torvalds
2016-12-18 3:26 ` Linus Torvalds
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=20161216230823.GU1555@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=torvalds@linux-foundation.org \
/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).