Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3634708imm; Mon, 2 Jul 2018 02:46:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfI7JsdP23khaPkmAorI5Bb6wvS8dMh0MpJe9RIdt6XjUed4WjpKBsNQGLOq7Ey6iM3rETX X-Received: by 2002:a62:8d7:: with SMTP id 84-v6mr3941965pfi.172.1530524784052; Mon, 02 Jul 2018 02:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530524784; cv=none; d=google.com; s=arc-20160816; b=Zcmxwuc582O/SJmREeLQ7aE3MtjGo0S8JfN2pbfB/uO02fMe+E1bOdOY2xQcMl5yHi 7PlPnRPkOYepsioLiHRtdVFUb51NOQVKb3ngrXG9b24bEVv9sYtTaYx97s3+lR8n1nk6 PvQ0r6odvRjj5EBIjHGMWuj6I+iHAol1OTGywkaPudvoNmLbqYi5wFKZwuGIUtphoNza 4+CS71mnYUNYJkl3CvpiZ/GfM/D/Lz7k5Jci5WvmQ7ubTVfI0u39hKoG+IFyA9HBNJhe kZGYxGE61io3jW2Z1gf3UTksEeRNsbU3k67ldAWIEPdkSXH+IZuHDR8lvaeCeoK3HbEL G9gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=3m6yas/FxN+eFT5OZOZnw6bGsZ/3ycAktGf6hTml+Og=; b=C3xlUoXCxCblD4menpeqz8suM98h/l3le2W23BO78czDMLu/mkLqIYBh/n3APbO8f3 XdtNZuxiY14YBsw5AeLLOX1PQVBCn/9e/O1kmxuLOQb6JZmUwY0f9Xzw+Z/kH+ZsAdeL 5kAKmSw7Exy98y2MDz8aUbZdhDW9nhQDylIyfNsVPGEU7YoFL/7Kkxpq569pNHfRSrWA hE+AVfK9AQeCESET2fWSKrLYrzyfOdizAGsMxahllUT+bj7PA2IkwNl2vedDSZqk3fM1 7yEu+6LIApc4HUGLVDA9VXGTeyj7MeH5kYYqpKVud6JFC3Rp3G2uOnrSlcDAYY4ocB0H Juaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9-v6si13318763pgo.397.2018.07.02.02.46.09; Mon, 02 Jul 2018 02:46:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934058AbeGBJc5 (ORCPT + 99 others); Mon, 2 Jul 2018 05:32:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933423AbeGBJcx (ORCPT ); Mon, 2 Jul 2018 05:32:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE2547D84D; Mon, 2 Jul 2018 09:32:52 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-88.ams2.redhat.com [10.36.116.88]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2BF22026D5B; Mon, 2 Jul 2018 09:32:51 +0000 (UTC) Subject: Re: [PATCH] Add renameat2 function [BZ #17662] To: Yury Norov Cc: libc-alpha@sourceware.org, Alexander Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org References: <20180630121447.E4C8643994575@oldenburg.str.redhat.com> <20180701214901.GA32498@yury-thinkpad> <60505ccf-a399-6320-74f5-e2e17965d25c@redhat.com> <20180702084622.GA15274@yury-thinkpad> From: Florian Weimer Message-ID: <83bc54c8-ea97-22f7-360f-523e5979864a@redhat.com> Date: Mon, 2 Jul 2018 11:32:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180702084622.GA15274@yury-thinkpad> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 09:32:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 09:32:52 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'fweimer@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/02/2018 10:46 AM, Yury Norov wrote: > Is my understanding correct that glibc community finds > inappropriate for their use, and prefer to re-introduce (duplicate) > its functionality locally? I think it's wrong. The right way to go > is to make kernel headers comfortable for users instead of ignoring > it. In some cases, we already use UAPI headers ( is an example), but it is not always possible. > Are you OK to switch to kernel RENAME_* definitions if they will be > located in separated small file? Like in the patch below. > > Signed-off-by: Yury Norov > --- > include/uapi/linux/fs.h | 4 +--- > include/uapi/linux/rename.h | 12 ++++++++++++ > 2 files changed, 13 insertions(+), 3 deletions(-) > create mode 100644 include/uapi/linux/rename.h > > diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h > index c27576d471c2..46c03ea31a76 100644 > --- a/include/uapi/linux/fs.h > +++ b/include/uapi/linux/fs.h > @@ -44,9 +44,7 @@ > #define SEEK_HOLE 4 /* seek to the next hole */ > #define SEEK_MAX SEEK_HOLE > > -#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */ > -#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */ > -#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */ > +#include > > struct file_clone_range { > __s64 src_fd; > diff --git a/include/uapi/linux/rename.h b/include/uapi/linux/rename.h > new file mode 100644 > index 000000000000..7178f0565657 > --- /dev/null > +++ b/include/uapi/linux/rename.h > @@ -0,0 +1,12 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +#ifndef _UAPI_LINUX_RENAME_H > +#define _UAPI_LINUX_RENAME_H > + > +/* > + * Definitions for rename syscall family. > + */ > +#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */ > +#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */ > +#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */ > + > +#endif /* _UAPI_LINUX_RENAME_H */ This would help. We would need to provide definitions for compatibility with older kernel headers locally, but on newer kernels, we could use the UAPI header file. Thanks, Florian