[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH hurd x2] - Rebased
From: |
Samuel Thibault |
Subject: |
Re: [PATCH hurd x2] - Rebased |
Date: |
Mon, 8 Mar 2021 20:51:51 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Damien Zammit, le lun. 08 mars 2021 13:15:05 +1100, a ecrit:
> [PATCH 1/2] pci-arbiter: Fix brokenness
>
> This patch does not include mustbedir option because I believe there
> is already logic that detects if it is looking up a directory,
> by checking the entry->dir != 0.
No, there seems to be a misunderstanding.
I'm not talking about checking that struct node *dir is a proper
directory.
I'm not talking about netfs_attempt_lookup handling directory nodes
properly.
I'm not talking about netfs_get_dirents checking that it is passed a
directory node.
I'm talking about the Posix requirement that when you open("foo",
O_DIRECTORY), and foo is not actually a directory, it shall fail. This
is implemented on the hurd by appending a trailing slash, see
__hurd_file_name_lookup in glibc. Translators then have to implement it
in netfs_attempt_lookup: when the name ends with a slash, they have to
check that the looked up node really is a directory. See libdiskfs'
diskfs_S_dir_lookup: when it sees a trailing /, it notes mustbedir=1, which is
later on checked:
if (mustbedir && type != S_IFDIR)
{
err = ENOTDIR;
goto out;
}
In the pci-arbiter case that check is missing.
Samuel