public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
  • * [PATCH xfsprogs-5.14.2 URGENT] libxfs: hide the drainbamaged fallthrough macro from xfslibs
    @ 2021-12-05 17:49     ` Darrick J. Wong
      2021-12-05 17:49       ` Bug#1000974: " Darrick J. Wong
                             ` (3 more replies)
      0 siblings, 4 replies; 14+ messages in thread
    From: Darrick J. Wong @ 2021-12-05 17:49 UTC (permalink / raw)
      To: Eric Sandeen
      Cc: Thomas Goirand, 1000974, Giovanni Mascellani, xfslibs-dev, xfs,
    	gustavoars, keescook
    
    From: Darrick J. Wong <djwong@kernel.org>
    
    Back in mid-2021, Kees and Gustavo rammed into the kernel a bunch of
    static checker "improvements" that redefined '/* fallthrough */'
    comments for switch statements as a macro that virtualizes either that
    same comment, a do-while loop, or a compiler __attribute__.  This was
    necessary to work around the poor decision-making of the clang, gcc, and
    C language standard authors, who collectively came up with four mutually
    incompatible ways to document a lack of branching in a code flow.
    
    Having received ZERO HELP porting this to userspace, Eric and I
    foolishly dumped that crap into linux.h, which was a poor decision
    because we keep forgetting that linux.h is exported as a userspace
    header.  This has now caused downstream regressions in Debian[1] and
    will probably cause more problems in the other distros.
    
    Move it to platform_defs.h since that's not shipped publicly and leave a
    warning to anyone else who dare modify linux.h.
    
    [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000974
    
    Fixes: df9c7d8d ("xfs: Fix fall-through warnings for Clang")
    Cc: 1000974@bugs.debian.org, gustavoars@kernel.org, keescook@chromium.org
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    ---
     include/linux.h            |   20 ++------------------
     include/platform_defs.h.in |   21 +++++++++++++++++++++
     2 files changed, 23 insertions(+), 18 deletions(-)
    
    diff --git a/include/linux.h b/include/linux.h
    index 24650228..054117aa 100644
    --- a/include/linux.h
    +++ b/include/linux.h
    @@ -360,24 +360,8 @@ fsmap_advance(
     #endif /* HAVE_MAP_SYNC */
     
     /*
    - * Add the pseudo keyword 'fallthrough' so case statement blocks
    - * must end with any of these keywords:
    - *   break;
    - *   fallthrough;
    - *   continue;
    - *   goto <label>;
    - *   return [expression];
    - *
    - *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
    + * Reminder: anything added to this file will be compiled into downstream
    + * userspace projects!
      */
    -#if defined __has_attribute
    -#  if __has_attribute(__fallthrough__)
    -#    define fallthrough                    __attribute__((__fallthrough__))
    -#  else
    -#    define fallthrough                    do {} while (0)  /* fallthrough */
    -#  endif
    -#else
    -#    define fallthrough                    do {} while (0)  /* fallthrough */
    -#endif
     
     #endif	/* __XFS_LINUX_H__ */
    diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
    index 7c6b3ada..6e6f26ef 100644
    --- a/include/platform_defs.h.in
    +++ b/include/platform_defs.h.in
    @@ -113,4 +113,25 @@ static inline size_t __ab_c_size(size_t a, size_t b, size_t c)
     		sizeof(*(p)->member) + __must_be_array((p)->member),	\
     		sizeof(*(p)))
     
    +/*
    + * Add the pseudo keyword 'fallthrough' so case statement blocks
    + * must end with any of these keywords:
    + *   break;
    + *   fallthrough;
    + *   continue;
    + *   goto <label>;
    + *   return [expression];
    + *
    + *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
    + */
    +#if defined __has_attribute
    +#  if __has_attribute(__fallthrough__)
    +#    define fallthrough                    __attribute__((__fallthrough__))
    +#  else
    +#    define fallthrough                    do {} while (0)  /* fallthrough */
    +#  endif
    +#else
    +#    define fallthrough                    do {} while (0)  /* fallthrough */
    +#endif
    +
     #endif	/* __XFS_PLATFORM_DEFS_H__ */
    
    ^ permalink raw reply related	[flat|nested] 14+ messages in thread
  • [parent not found: <handler.1000974.B1000974.163872562421581.ackinfo@bugs.debian.org>]
  • * Bug#1000974: marked as done (xfs/linux.h defines common word "fallthrough" breaking unrelated headers)
           [not found]   ` <163839370805.58768.6385074074873965943.reportbug@zbuz.infomaniak.ch>
                           ` (2 preceding siblings ...)
           [not found]     ` <handler.1000974.B1000974.163872562421581.ackinfo@bugs.debian.org>
    @ 2021-12-07 12:36     ` Debian Bug Tracking System
      2021-12-07 12:54     ` Debian Bug Tracking System
      4 siblings, 0 replies; 14+ messages in thread
    From: Debian Bug Tracking System @ 2021-12-07 12:36 UTC (permalink / raw)
      To: Bastian Germann
    
    [-- Attachment #1: Type: text/plain, Size: 865 bytes --]
    
    Your message dated Tue, 7 Dec 2021 13:32:48 +0100
    with message-id <1ae1f860-e164-4e25-0c59-d4a3bb8587c2@debian.org>
    and subject line fixed upstream
    has caused the Debian Bug report #1000974,
    regarding xfs/linux.h defines common word "fallthrough" breaking unrelated headers
    to be marked as done.
    
    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.
    
    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system
    misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)
    
    
    -- 
    1000974: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000974
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems
    
    [-- Attachment #2: Type: message/rfc822, Size: 3861 bytes --]
    
    From: Thomas Goirand <zigo@debian.org>
    To: Debian Bug Tracking System <submit@bugs.debian.org>
    Subject: copy_move_algo.hpp:1083:10: error: ‘__fallthrough__’ was not declared in this scope; did you mean ‘fallthrough’?
    Date: Wed, 01 Dec 2021 22:21:48 +0100
    Message-ID: <163839370805.58768.6385074074873965943.reportbug@zbuz.infomaniak.ch>
    
    Package: libboost1.74-dev
    Version: 1.74.0-13
    Severity: important
    
    Hi there!
    
    When building Ceph (current version in Experimental), since a few days/weeks,
    I get this:
    
    In file included from /root/ceph/ceph/src/seastar/src/core/file.cc:28:
    /usr/include/boost/container/detail/copy_move_algo.hpp: In function ‘typename boost::move_detail::enable_if_c<(boost::container::dtl::is_memtransfer_copy_assignable<F, G>::value && true), void>::type boost::container::deep_swap_alloc_n(A
    llocator&, F, typename boost::container::allocator_traits<Allocator>::size_type, G, typename boost::container::allocator_traits<Allocator>::size_type)’:
    /usr/include/boost/container/detail/copy_move_algo.hpp:1083:10: error: ‘__fallthrough__’ was not declared in this scope; did you mean ‘fallthrough’?
     1083 |          BOOST_FALLTHROUGH;
          |          ^~~~~~~~~~~~~~~~~
    
    To me, it looks like a bug in Boost itself, as this is where the
    BOOST_FALLTHROUGH macro is defined.
    
    Note that in Ceph, I had the same issue, until I redefined the
    macro like this directly:
    #define FMT_FALLTHROUGH [[gnu::fallthrough]]
    
    removing the conditional:
    #if __cplusplus == 201103L || __cplusplus == 201402L
    
    which doesn't seem to get some matching, and then the error in
    the subject of this bug report went away, at least for the Ceph
    part (well, fmt which Ceph embedds...).
    
    Is this still a problem in Ceph, or am I right that it probably
    is an issue in Boost?
    
    I can't get my head around this issue which has been blocking me
    for weeks. What's annoying is that it used to build fine, and
    I don't know what changed in unstable to make it fail to way.
    If the issue is in Ceph's code, then I would happily recieve
    advices.
    
    Your thoughts?
    
    Cheers,
    
    Thomas Goirand (zigo)
    
    [-- Attachment #3: Type: message/rfc822, Size: 2568 bytes --]
    
    From: Bastian Germann <bage@debian.org>
    To: 1000974-done@bugs.debian.org
    Subject: fixed upstream
    Date: Tue, 7 Dec 2021 13:32:48 +0100
    Message-ID: <1ae1f860-e164-4e25-0c59-d4a3bb8587c2@debian.org>
    
    Version: 5.14.2-1
    
    This was fixed by commit 135ce1ed0a99 (libxfs: hide the drainbamaged fallthrough macro from xfslibs)
    
    ^ permalink raw reply	[flat|nested] 14+ messages in thread
  • * Bug#1000974: marked as done (xfs/linux.h defines common word "fallthrough" breaking unrelated headers)
           [not found]   ` <163839370805.58768.6385074074873965943.reportbug@zbuz.infomaniak.ch>
                           ` (3 preceding siblings ...)
      2021-12-07 12:36     ` Bug#1000974: marked as done (xfs/linux.h defines common word "fallthrough" breaking unrelated headers) Debian Bug Tracking System
    @ 2021-12-07 12:54     ` Debian Bug Tracking System
      4 siblings, 0 replies; 14+ messages in thread
    From: Debian Bug Tracking System @ 2021-12-07 12:54 UTC (permalink / raw)
      To: Nathan Scott
    
    [-- Attachment #1: Type: text/plain, Size: 879 bytes --]
    
    Your message dated Tue, 07 Dec 2021 12:50:53 +0000
    with message-id <E1muZvp-000DCs-Vb@fasolo.debian.org>
    and subject line Bug#1000974: fixed in xfsprogs 5.14.2-1
    has caused the Debian Bug report #1000974,
    regarding xfs/linux.h defines common word "fallthrough" breaking unrelated headers
    to be marked as done.
    
    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.
    
    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system
    misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)
    
    
    -- 
    1000974: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000974
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems
    
    [-- Attachment #2: Type: message/rfc822, Size: 3861 bytes --]
    
    From: Thomas Goirand <zigo@debian.org>
    To: Debian Bug Tracking System <submit@bugs.debian.org>
    Subject: copy_move_algo.hpp:1083:10: error: ‘__fallthrough__’ was not declared in this scope; did you mean ‘fallthrough’?
    Date: Wed, 01 Dec 2021 22:21:48 +0100
    Message-ID: <163839370805.58768.6385074074873965943.reportbug@zbuz.infomaniak.ch>
    
    Package: libboost1.74-dev
    Version: 1.74.0-13
    Severity: important
    
    Hi there!
    
    When building Ceph (current version in Experimental), since a few days/weeks,
    I get this:
    
    In file included from /root/ceph/ceph/src/seastar/src/core/file.cc:28:
    /usr/include/boost/container/detail/copy_move_algo.hpp: In function ‘typename boost::move_detail::enable_if_c<(boost::container::dtl::is_memtransfer_copy_assignable<F, G>::value && true), void>::type boost::container::deep_swap_alloc_n(A
    llocator&, F, typename boost::container::allocator_traits<Allocator>::size_type, G, typename boost::container::allocator_traits<Allocator>::size_type)’:
    /usr/include/boost/container/detail/copy_move_algo.hpp:1083:10: error: ‘__fallthrough__’ was not declared in this scope; did you mean ‘fallthrough’?
     1083 |          BOOST_FALLTHROUGH;
          |          ^~~~~~~~~~~~~~~~~
    
    To me, it looks like a bug in Boost itself, as this is where the
    BOOST_FALLTHROUGH macro is defined.
    
    Note that in Ceph, I had the same issue, until I redefined the
    macro like this directly:
    #define FMT_FALLTHROUGH [[gnu::fallthrough]]
    
    removing the conditional:
    #if __cplusplus == 201103L || __cplusplus == 201402L
    
    which doesn't seem to get some matching, and then the error in
    the subject of this bug report went away, at least for the Ceph
    part (well, fmt which Ceph embedds...).
    
    Is this still a problem in Ceph, or am I right that it probably
    is an issue in Boost?
    
    I can't get my head around this issue which has been blocking me
    for weeks. What's annoying is that it used to build fine, and
    I don't know what changed in unstable to make it fail to way.
    If the issue is in Ceph's code, then I would happily recieve
    advices.
    
    Your thoughts?
    
    Cheers,
    
    Thomas Goirand (zigo)
    
    [-- Attachment #3: Type: message/rfc822, Size: 5238 bytes --]
    
    From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>
    To: 1000974-close@bugs.debian.org
    Subject: Bug#1000974: fixed in xfsprogs 5.14.2-1
    Date: Tue, 07 Dec 2021 12:50:53 +0000
    Message-ID: <E1muZvp-000DCs-Vb@fasolo.debian.org>
    
    Source: xfsprogs
    Source-Version: 5.14.2-1
    Done: Nathan Scott <nathans@debian.org>
    
    We believe that the bug you reported is fixed in the latest version of
    xfsprogs, which is due to be installed in the Debian FTP archive.
    
    A summary of the changes between this version and the previous one is
    attached.
    
    Thank you for reporting the bug, which will now be closed.  If you
    have further comments please address them to 1000974@bugs.debian.org,
    and the maintainer will reopen the bug report if appropriate.
    
    Debian distribution maintenance software
    pp.
    Nathan Scott <nathans@debian.org> (supplier of updated xfsprogs package)
    
    (This message was generated automatically at their request; if you
    believe that there is a problem with it please contact the archive
    administrators by mailing ftpmaster@ftp-master.debian.org)
    
    
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    Format: 1.8
    Date: Mon, 06 Dec 2021 14:26:57 -0500
    Source: xfsprogs
    Architecture: source
    Version: 5.14.2-1
    Distribution: unstable
    Urgency: medium
    Maintainer: XFS Development Team <linux-xfs@vger.kernel.org>
    Changed-By: Nathan Scott <nathans@debian.org>
    Closes: 1000974
    Changes:
     xfsprogs (5.14.2-1) unstable; urgency=medium
     .
       * New upstream release
         - Move rogue fallthrough macro out of linux.h (Closes: #1000974)
    Checksums-Sha1:
     7d58d8887618f090bfc2b5c0d9c309da788ba960 2017 xfsprogs_5.14.2-1.dsc
     035e552cf4a08d5dbe1330ec1e3e6ceeb21b6bc9 1308912 xfsprogs_5.14.2.orig.tar.xz
     ef951cda194275eee5c3975cfd46544cf0f70a67 14316 xfsprogs_5.14.2-1.debian.tar.xz
     2d71d75e23c654180f1c794e4d5c8c569f62873f 6141 xfsprogs_5.14.2-1_source.buildinfo
    Checksums-Sha256:
     6fcd3408e1c1edc0d776f54323424dd36eeaffc148191911c464d5a02b2bad6b 2017 xfsprogs_5.14.2-1.dsc
     01ccd3ef9df2837753a5d876b8da84ea957d13d7a461b8c46e8afa4eb09aabc8 1308912 xfsprogs_5.14.2.orig.tar.xz
     9581848bd59128cdd38ccaa4c92d82d5ddd66c74baa9dc2fc76fb5146497af4a 14316 xfsprogs_5.14.2-1.debian.tar.xz
     4d20924cfc79905a769dbff0aca10eab696536aab5f591e36e9e35001f63a5f6 6141 xfsprogs_5.14.2-1_source.buildinfo
    Files:
     14d5f362b8d4ea4bee80edb78a36ad9e 2017 admin optional xfsprogs_5.14.2-1.dsc
     597e7067b8aa24d440bc87c29e987377 1308912 admin optional xfsprogs_5.14.2.orig.tar.xz
     89ea7c8a994352dcecd267a0ec13136c 14316 admin optional xfsprogs_5.14.2-1.debian.tar.xz
     4e41a97053eeb8ec0c6547e293683776 6141 admin optional xfsprogs_5.14.2-1_source.buildinfo
    
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEEQGIgyLhVKAI3jM5BH1x6i0VWQxQFAmGvU4sACgkQH1x6i0VW
    QxS0egv9HwfcbxyRn43bj+CxNKMCdKtgIPfV0SZxejKwarbdDg3d8f4/1i7gNVpJ
    +isPdnKvVULyxEhQxdoYfsjWaTCCX3YMlyrd6i5+2nrn6J9cwXrrJJdjPWvMgXR2
    o2u+brvm9cPYllAbbEVUYe6dtHY+/cH1c16W1SYK3yln7MWWWCTvAT0a7YrnrZQj
    7FVdd0qcbM+PU/m2qwpUxz2KmtVjJ8RfiF+a/X7P1zeAxAoODFx3GRRY9cTyvgnV
    tDwAdlSu4W6UgiKwgTpDFUT6EPRigEEqjTk3k0BgvYeFEidX57TsknQXwWKn3dI/
    Dxfo5wxGVlDIywj4iN9EugsYCBwW8ggm60St/BiJhuNpgup339yUBGtszm/x97RM
    XLKTOgb642bqTVu1Otee+Bdd5VSMwlmkyUnDDvuh52EPF3uFNf55sgiYsv02ATrB
    jb8rcN1zeqUZ9r+9m6w65pp2wQX6HAWqZSUEl2HToPITse3OPwwCPUKZja+BYpT5
    bGdytpiC
    =ORx6
    -----END PGP SIGNATURE-----
    
    ^ permalink raw reply	[flat|nested] 14+ messages in thread

  • end of thread, other threads:[~2021-12-07 12:54 UTC | newest]
    
    Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <9b9bda73-9554-0c75-824d-f8d1b9b98e19@debian.org>
         [not found] ` <7686ac7e-0df1-a98c-27ce-51dc5e46c55e@debian.org>
         [not found]   ` <163839370805.58768.6385074074873965943.reportbug@zbuz.infomaniak.ch>
         [not found]     ` <c7ccff50-c177-7f96-2d99-2077f77374ad@debian.org>
    2021-12-05 15:57       ` Processed (with 1 error): Re: Bug#1000974: copy_move_algo.hpp:1083:10: error: ‘__fallthrough__’ was not declared in this scope; did you mean ‘fallthrough’? Debian Bug Tracking System
    2021-12-05 17:33       ` Thomas Goirand
    2021-12-05 17:45         ` Darrick J. Wong
    2021-12-05 17:49     ` [PATCH xfsprogs-5.14.2 URGENT] libxfs: hide the drainbamaged fallthrough macro from xfslibs Darrick J. Wong
    2021-12-05 17:49       ` Bug#1000974: " Darrick J. Wong
    2021-12-05 21:10       ` Dave Chinner
    2021-12-05 21:10         ` Dave Chinner
    2021-12-06 14:26       ` Eric Sandeen
    2021-12-06 14:26         ` Bug#1000974: " Eric Sandeen
    2021-12-06 20:15       ` Kees Cook
    2021-12-06 20:15         ` Bug#1000974: " Kees Cook
         [not found]     ` <handler.1000974.B1000974.163872562421581.ackinfo@bugs.debian.org>
    2021-12-05 19:00       ` Bug#1000974: Info received (Bug#1000974: copy_move_algo.hpp:1083:10: error: ‘__fallthrough__’ was not declared in this scope; did you mean ‘fallthrough’?) Thomas Goirand
    2021-12-07 12:36     ` Bug#1000974: marked as done (xfs/linux.h defines common word "fallthrough" breaking unrelated headers) Debian Bug Tracking System
    2021-12-07 12:54     ` Debian Bug Tracking System
    

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