Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1412573
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. |
| Date | 2016-06-02 23:50 +0200 |
| Message-ID | <rFIF3-2WQ-11@gated-at.bofh.it> (permalink) |
| References | (11 earlier) <rFD2G-7GN-15@gated-at.bofh.it> <rFG0y-1gi-17@gated-at.bofh.it> <rFHzj-2l4-7@gated-at.bofh.it> <rFHzj-2l4-5@gated-at.bofh.it> <rFIvo-2TE-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jun 2, 2016 at 2:23 PM, Eric W. Biederman <ebiederm@xmission.com> wrote:
>
> We certainly don't need the permission check.
I agree that we don't need it, but it does simplify the code, and it
doesn't actually harm anything, since the thing we check for
permissions is the same /dev directory, which we already know we had
lookup permissions for for the original ptmx node anyway.
The permission checks I didn't like were the permission checks for the
pts/ and pts/ptmx nodes, because they had nothing to do with the
permission for the original node. In contrast, this is just about a
redundant permission check we already did, and that simplifies the
code a bit.
That said, you're right that it needs to use IS_ERR(path.dentry). And
the whole "lookup_one_len_unlocked()" simplification is just a small
detail that doesn't much matter, so it's not a big deal.
And it is arguable that "d_hash_and_lookup()" that you use is actually
simpler than "lookup_one_len_unlocked()", since we are really only
need to look into the dentry cache, and that's all that
d_hash_and_lookup() does (ie it only ever does a d_lookup(), while
lookup_one_len_unlocked() ends up doing a full lookup in the failuer
case that we don't even care about.
So I don't feel very strongly about it. Your patch is ok by me.
Linus
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-06-02 17:50 +0200
Re: [PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-02 21:00 +0200
Re: [PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. "H. Peter Anvin" <hpa@zytor.com> - 2016-06-02 22:40 +0200
Re: [PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-06-02 23:40 +0200
Re: [PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-02 23:50 +0200
Re: [PATCH tty-next] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-06-02 22:40 +0200
csiph-web