All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/9] Switch defines to enums
Date: Wed, 28 Nov 2018 14:25:49 +0100	[thread overview]
Message-ID: <20181128132549.GM2842@twin.jikos.cz> (raw)
In-Reply-To: <45dcab9e-fb88-8980-90d9-1875ea1ee992@gmx.com>

On Wed, Nov 28, 2018 at 09:33:50AM +0800, Qu Wenruo wrote:
> On 2018/11/28 上午3:53, David Sterba wrote:
> > This is motivated by a merging mistake that happened a few releases ago.
> > Two patches updated BTRFS_FS_* flags independently to the same value,
> > git did not see any direct merge conflict. The two values got mixed at
> > runtime and caused crash.
> > 
> > Update all #define sequential values, the above merging problem would
> > not happen as there would be a conflict and the enum value
> > auto-increment would prevent duplicated values anyway.
> 
> Just one small question for the bitmap usage.
> 
> For enum we won't directly know the last number is, my concern is if
> we're using u16 as bitmap and there is some enum over 15, will we get a
> warning at compile time or some bug would just sneak into kernel?

Do you have a concrete example where this would happen? Most bits are
used in 'long' that should be at least 32. I'm not aware of 16bit bits
flags.

  reply	other threads:[~2018-11-28 13:26 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 19:53 [PATCH 0/9] Switch defines to enums David Sterba
2018-11-27 19:53 ` [PATCH 1/9] btrfs: switch BTRFS_FS_STATE_* " David Sterba
2018-11-28  0:24   ` Omar Sandoval
2018-11-28 15:22     ` David Sterba
2018-11-28  1:18   ` Qu Wenruo
2018-11-28 12:49   ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* " David Sterba
2018-11-28  0:25   ` Omar Sandoval
2018-11-28  1:19   ` Qu Wenruo
2018-11-28 12:50   ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 3/9] btrfs: switch BTRFS_FS_* " David Sterba
2018-11-28  0:28   ` Omar Sandoval
2018-11-28  1:21   ` Qu Wenruo
2018-11-27 19:53 ` [PATCH 4/9] btrfs: switch BTRFS_ROOT_* " David Sterba
2018-11-28  0:30   ` Omar Sandoval
2018-11-28  1:22   ` Qu Wenruo
2018-11-28 13:17   ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 5/9] btrfs: swtich EXTENT_BUFFER_* " David Sterba
2018-11-28  0:31   ` Omar Sandoval
2018-11-28  1:24   ` Qu Wenruo
2018-11-28 13:19   ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 6/9] btrfs: switch EXTENT_FLAG_* " David Sterba
2018-11-28  0:32   ` Omar Sandoval
2018-11-28  1:25   ` Qu Wenruo
2018-11-28 13:26   ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 7/9] btrfs: switch BTRFS_*_LOCK " David Sterba
2018-11-28  0:37   ` Omar Sandoval
2018-11-28 13:22     ` David Sterba
2018-11-28  1:26   ` Qu Wenruo
2018-11-27 19:53 ` [PATCH 8/9] btrfs: switch BTRFS_ORDERED_* " David Sterba
2018-11-28  0:37   ` Omar Sandoval
2018-11-28  1:32   ` Qu Wenruo
2018-11-28 13:28   ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 9/9] btrfs: drop extra enum initialization where using defaults David Sterba
2018-11-28  0:38   ` Omar Sandoval
2018-11-28  1:35   ` Qu Wenruo
2018-11-28 13:29   ` Johannes Thumshirn
2018-11-28  1:33 ` [PATCH 0/9] Switch defines to enums Qu Wenruo
2018-11-28 13:25   ` David Sterba [this message]
2018-11-28 13:50     ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181128132549.GM2842@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.