public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition
@ 2020-04-01  3:26 Eugene Syromiatnikov
  2020-04-01  6:47 ` Nikolay Borisov
  2020-04-10 16:45 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Eugene Syromiatnikov @ 2020-04-01  3:26 UTC (permalink / raw)
  To: linux-kernel, linux-btrfs, David Sterba, Nikolay Borisov
  Cc: Josef Bacik, Chris Mason, Dmitry V. Levin

The commit 9c1036fdb1d1ff1b ("btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC
support") breaks strace build with the kernel headers from git:

    btrfs.c: In function "btrfs_test_subvol_ioctls":
    btrfs.c:531:23: error: "BTRFS_SUBVOL_CREATE_ASYNC" undeclared (first use
    in this function)
       vol_args_v2.flags = BTRFS_SUBVOL_CREATE_ASYNC;

Moreover, it is improper to break UAPI anyway.

Restore the macro definition and put it under "#ifndef __KERNEL__"
in order to prevent inadvertent in-kernel usage.

Fixes: 9c1036fdb1d1ff1b ("btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC support")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
---
 include/uapi/linux/btrfs.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 8134924..e6b6cb0f 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -36,12 +36,10 @@ struct btrfs_ioctl_vol_args {
 #define BTRFS_DEVICE_PATH_NAME_MAX	1024
 #define BTRFS_SUBVOL_NAME_MAX 		4039
 
-/*
- * Deprecated since 5.7:
- *
- * BTRFS_SUBVOL_CREATE_ASYNC	(1ULL << 0)
- */
-
+#ifndef __KERNEL__
+/* Deprecated since 5.7 */
+# define BTRFS_SUBVOL_CREATE_ASYNC	(1ULL << 0)
+#endif
 #define BTRFS_SUBVOL_RDONLY		(1ULL << 1)
 #define BTRFS_SUBVOL_QGROUP_INHERIT	(1ULL << 2)
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition
  2020-04-01  3:26 [PATCH] btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition Eugene Syromiatnikov
@ 2020-04-01  6:47 ` Nikolay Borisov
  2020-04-10 16:45 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Borisov @ 2020-04-01  6:47 UTC (permalink / raw)
  To: Eugene Syromiatnikov, linux-kernel, linux-btrfs, David Sterba
  Cc: Josef Bacik, Chris Mason, Dmitry V. Levin



On 1.04.20 г. 6:26 ч., Eugene Syromiatnikov wrote:
> The commit 9c1036fdb1d1ff1b ("btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC
> support") breaks strace build with the kernel headers from git:
> 
>     btrfs.c: In function "btrfs_test_subvol_ioctls":
>     btrfs.c:531:23: error: "BTRFS_SUBVOL_CREATE_ASYNC" undeclared (first use
>     in this function)
>        vol_args_v2.flags = BTRFS_SUBVOL_CREATE_ASYNC;
> 
> Moreover, it is improper to break UAPI anyway.
> 
> Restore the macro definition and put it under "#ifndef __KERNEL__"
> in order to prevent inadvertent in-kernel usage.
> 
> Fixes: 9c1036fdb1d1ff1b ("btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC support")
> Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>

Ops, sorry about that:

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  include/uapi/linux/btrfs.h | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index 8134924..e6b6cb0f 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -36,12 +36,10 @@ struct btrfs_ioctl_vol_args {
>  #define BTRFS_DEVICE_PATH_NAME_MAX	1024
>  #define BTRFS_SUBVOL_NAME_MAX 		4039
>  
> -/*
> - * Deprecated since 5.7:
> - *
> - * BTRFS_SUBVOL_CREATE_ASYNC	(1ULL << 0)
> - */
> -
> +#ifndef __KERNEL__
> +/* Deprecated since 5.7 */
> +# define BTRFS_SUBVOL_CREATE_ASYNC	(1ULL << 0)
> +#endif
>  #define BTRFS_SUBVOL_RDONLY		(1ULL << 1)
>  #define BTRFS_SUBVOL_QGROUP_INHERIT	(1ULL << 2)
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition
  2020-04-01  3:26 [PATCH] btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition Eugene Syromiatnikov
  2020-04-01  6:47 ` Nikolay Borisov
@ 2020-04-10 16:45 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2020-04-10 16:45 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: linux-kernel, linux-btrfs, David Sterba, Nikolay Borisov,
	Josef Bacik, Chris Mason, Dmitry V. Levin

On Wed, Apr 01, 2020 at 05:26:50AM +0200, Eugene Syromiatnikov wrote:
> The commit 9c1036fdb1d1ff1b ("btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC
> support") breaks strace build with the kernel headers from git:
> 
>     btrfs.c: In function "btrfs_test_subvol_ioctls":
>     btrfs.c:531:23: error: "BTRFS_SUBVOL_CREATE_ASYNC" undeclared (first use
>     in this function)
>        vol_args_v2.flags = BTRFS_SUBVOL_CREATE_ASYNC;
> 
> Moreover, it is improper to break UAPI anyway.

IIRC the reason for the UAPI exports was to let strace use the includes
to decode the ioctls, so for that I agree it's improper to break the
build, sorry. The ioctls are a public interface so it's an ABI.  Patch
added to 5.7 queue, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-10 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-01  3:26 [PATCH] btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition Eugene Syromiatnikov
2020-04-01  6:47 ` Nikolay Borisov
2020-04-10 16:45 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox