[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVED
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVEDIR flag |
Date: |
Tue, 29 May 2018 22:43:11 +0200 |
On Sat, 26 May 2018 01:23:09 -0400
address@hidden wrote:
> From: Keno Fischer <address@hidden>
>
> This code relied on P9_DOTL_AT_REMOVEDIR and AT_REMOVEDIR having the same
> numerical value, but on Darwin, they do not.
>
> Signed-off-by: Keno Fischer <address@hidden>
> ---
> hw/9pfs/9p-local.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
> index 6e0b2e8..c55ea25 100644
> --- a/hw/9pfs/9p-local.c
> +++ b/hw/9pfs/9p-local.c
> @@ -1376,7 +1376,17 @@ static int local_unlinkat(FsContext *ctx, V9fsPath
> *dir,
> return -1;
> }
>
> - ret = local_unlinkat_common(ctx, dirfd, name, flags);
> + if ((flags & ~P9_DOTL_AT_REMOVEDIR) != 0) {
The != 0 isn't needed but...
> + errno = EINVAL;
> + return -1;
... I'm more concerned about this new error path. How can this happen ?
> + }
> +
> + size_t rflags = 0;
Please declare this at the beginning of the function.
> + if (flags & P9_DOTL_AT_REMOVEDIR) {
> + rflags |= AT_REMOVEDIR;
> + }
> +
> + ret = local_unlinkat_common(ctx, dirfd, name, rflags);
> close_preserve_errno(dirfd);
> return ret;
> }
[Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVEDIR flag, keno, 2018/05/26
- Re: [Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVEDIR flag,
Greg Kurz <=
[Qemu-devel] [PATCH 08/13] 9p: darwin: Ignore O_{NOATIME, DIRECT}, keno, 2018/05/26
[Qemu-devel] [PATCH 09/13] 9p: darwin: Provide a compatibility definition for XATTR_SIZE_MAX, keno, 2018/05/26
[Qemu-devel] [PATCH 10/13] 9p: darwin: *xattr_nofollow implementations, keno, 2018/05/26