From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Evgeniy Polyakov <zbr@ioremap.net>, Joe Perches <joe@perches.com>,
greg@kroah.com, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [take 3] pohmelfs: call for inclusion
Date: Wed, 21 Mar 2012 21:18:35 +0000 [thread overview]
Message-ID: <20120321211835.GQ6589@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFwm+wfMDFwpcngKwrQEeh53JpsDXr9CPU6Xf0mfGvJHKg@mail.gmail.com>
On Wed, Mar 21, 2012 at 02:02:43PM -0700, Linus Torvalds wrote:
> I can't really say that I tend to care deeply about the innards of
> some unusual filesystem that hopefully cannot possibly impact anything
> else. So as long as you keep people like Al happy (or at least not
> overly unhappy), I'm unlikely to worry too much.
As far as I can see, it's still suffering the same problems it used to;
in particular, the games it plays with d_path() are completely bogus.
Take a look at this:
static int pohmelfs_construct_path_string(struct pohmelfs_inode *pi, void *data
int len)
{
struct path path;
struct dentry *d;
char *ptr;
int err = 0, strlen, reduce = 0;
d = d_find_alias(&pi->vfs_inode);
if (!d) {
err = -ENOENT;
goto err_out_exit;
}
spin_lock(¤t->fs->lock);
path.mnt = mntget(current->fs->root.mnt);
spin_unlock(¤t->fs->lock);
path.dentry = d;
if (!IS_ROOT(d) && d_unhashed(d))
reduce = 1;
ptr = d_path(&path, data, len);
if (IS_ERR(ptr)) {
err = PTR_ERR(ptr);
goto err_out_put;
}
if (reduce && len >= UNHASHED_OBSCURE_STRING_SIZE) {
char *end = data + len - UNHASHED_OBSCURE_STRING_SIZE;
*end = '\0';
}
strlen = len - (ptr - (char *)data);
memmove(data, ptr, strlen);
ptr = data;
err = strlen - 1; /* no including 0-byte */
pr_debug("%s: dname: '%s', len: %u, maxlen: %u, name: '%s', strlen: %d.\n",
__func__, d->d_name.name, d->d_name.len, len, ptr, strlen);
err_out_put:
dput(d);
mntput(path.mnt);
err_out_exit:
return err;
}
For Nth time: what happens to poor sod that happens to be chrooted
into that animal? We get pathname relative to process' root or to fs
root, whichever's closer. And no, it's used not just for debugging
printks...
I think I've asked that question at least 3 times. Never got anything
resembling an answer... Is that misspelled dentry_path()? Or is something
subtle going on and we really want different strings generated for
chrooted processes here?
next prev parent reply other threads:[~2012-03-21 21:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 12:18 [take 3] pohmelfs: call for inclusion Evgeniy Polyakov
2012-03-16 13:29 ` Joe Perches
2012-03-16 13:39 ` Evgeniy Polyakov
2012-03-16 13:43 ` Evgeniy Polyakov
2012-03-16 14:12 ` Joe Perches
2012-03-21 20:27 ` Evgeniy Polyakov
2012-03-21 21:02 ` Linus Torvalds
2012-03-21 21:18 ` Al Viro [this message]
2012-03-21 21:37 ` Evgeniy Polyakov
2012-03-21 21:54 ` Al Viro
2012-03-21 22:04 ` Evgeniy Polyakov
2012-03-21 22:28 ` Al Viro
2012-03-21 22:40 ` Evgeniy Polyakov
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=20120321211835.GQ6589@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=joe@perches.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
--cc=zbr@ioremap.net \
/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