All of lore.kernel.org
 help / color / mirror / Atom feed
* re: btrfs: extend balance filter usage to take minimum and maximum
@ 2015-11-12  9:36 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-11-12  9:36 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs

Hello David Sterba,

The patch bc3094673f22: "btrfs: extend balance filter usage to take
minimum and maximum" from Oct 20, 2015, leads to the following static
checker warning:

	fs/btrfs/volumes.c:3063 update_balance_args()
	warn: we tested 'bctl->data.flags & (1 << 8)' before and it was 'false'

fs/btrfs/volumes.c
  3054          /*
  3055           * Turn on usage filter if is not already used.  The idea is
  3056           * that chunks that we have already balanced should be
  3057           * reasonably full.  Don't do it for chunks that are being
  3058           * converted - that will keep us from relocating unconverted
  3059           * (albeit full) chunks.
  3060           */
  3061          if (!(bctl->data.flags & BTRFS_BALANCE_ARGS_USAGE) &&
  3062              !(bctl->data.flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) &&
  3063              !(bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT)) {

USAGE_RANGE and ARGS_CONVERT are both BIT(8) so this is duplicative.

  3064                  bctl->data.flags |= BTRFS_BALANCE_ARGS_USAGE;
  3065                  bctl->data.usage = 90;
  3066          }
  3067          if (!(bctl->sys.flags & BTRFS_BALANCE_ARGS_USAGE) &&
  3068              !(bctl->sys.flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) &&
  3069              !(bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT)) {

Same.

  3070                  bctl->sys.flags |= BTRFS_BALANCE_ARGS_USAGE;
  3071                  bctl->sys.usage = 90;
  3072          }
  3073          if (!(bctl->meta.flags & BTRFS_BALANCE_ARGS_USAGE) &&
  3074              !(bctl->meta.flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) &&
  3075              !(bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT)) {

Same.

  3076                  bctl->meta.flags |= BTRFS_BALANCE_ARGS_USAGE;
  3077                  bctl->meta.usage = 90;
  3078          }
  3079  }


regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-12  9:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12  9:36 btrfs: extend balance filter usage to take minimum and maximum Dan Carpenter

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.