This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/3] sem_open: allow RAMFS_MAGIC for mount points
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 23 Jan 2014 16:51:43 +0530
- Subject: Re: [PATCH 2/3] sem_open: allow RAMFS_MAGIC for mount points
- Authentication-results: sourceware.org; auth=none
- References: <1390458245-2287-1-git-send-email-vapier at gentoo dot org> <1390458245-2287-2-git-send-email-vapier at gentoo dot org>
On Thu, Jan 23, 2014 at 01:24:04AM -0500, Mike Frysinger wrote:
> A ramfs mount supports the same requirements as a tmpfs, so accept that
> as a magic type too.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> nptl/sem_open.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/nptl/sem_open.c b/nptl/sem_open.c
> index 529f636..9980cec 100644
> --- a/nptl/sem_open.c
> +++ b/nptl/sem_open.c
> @@ -61,7 +61,8 @@ __where_is_shmfs (void)
>
> /* The canonical place is /dev/shm. This is at least what the
> documentation tells everybody to do. */
> - if (__statfs (defaultmount, &f) == 0 && f.f_type == SHMFS_SUPER_MAGIC)
> + if (__statfs (defaultmount, &f) == 0 && (f.f_type == SHMFS_SUPER_MAGIC
> + || f.f_type == RAMFS_MAGIC))
Incorrect formatting. The || should align with the inner bracket.
> {
> /* It is in the normal place. */
> mountpoint.dir = (char *) defaultdir;
> @@ -95,7 +96,8 @@ __where_is_shmfs (void)
> /* First make sure this really is the correct entry. At least
> some versions of the kernel give wrong information because
> of the implicit mount of the shmfs for SysV IPC. */
> - if (__statfs (mp->mnt_dir, &f) != 0 || f.f_type != SHMFS_SUPER_MAGIC)
> + if (__statfs (mp->mnt_dir, &f) != 0 || (f.f_type != SHMFS_SUPER_MAGIC &&
> + f.f_type != RAMFS_MAGIC))
Incorrect formatting - the && should come down to the next line and
align with the inner bracket. The change itself looks OK to me for
2.20 when it opens.
Siddhesh
> continue;
>
> namelen = strlen (mp->mnt_dir);
> --
> 1.8.4.3
>