All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ofir Gal <ofir.gal@volumez.com>
Cc: song@kernel.org, yukuai3@huawei.com, hch@lst.de,
	linux-raid@vger.kernel.org
Subject: Re: [PATCH] md/md-bitmap: fix writing non bitmap pages
Date: Fri, 7 Jun 2024 06:53:36 +0200	[thread overview]
Message-ID: <20240607045336.GA2857@lst.de> (raw)
In-Reply-To: <20240606153223.2460253-1-ofir.gal@volumez.com>

On Thu, Jun 06, 2024 at 06:32:20PM +0300, Ofir Gal wrote:
> +	unsigned int bitmap_limit = (bitmap->storage.file_pages - pg_index) << PAGE_SHIFT;

Please split the line after the "<<".

>  	loff_t sboff, offset = mddev->bitmap_info.offset;
>  	sector_t ps = pg_index * PAGE_SIZE / SECTOR_SIZE;
>  	unsigned int size = PAGE_SIZE;
> @@ -273,7 +274,7 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
>  		/* DATA METADATA BITMAP - no problems */
>  	}
>  
> -	md_super_write(mddev, rdev, sboff + ps, (int) size, page);
> +	md_super_write(mddev, rdev, sboff + ps, (int)min(size, bitmap_limit), page);

and drop the pointless case here.

With that:


Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2024-06-07  4:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 15:32 [PATCH] md/md-bitmap: fix writing non bitmap pages Ofir Gal
2024-06-07  4:53 ` Christoph Hellwig [this message]
2024-06-07  7:29   ` Ofir Gal

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=20240607045336.GA2857@lst.de \
    --to=hch@lst.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=ofir.gal@volumez.com \
    --cc=song@kernel.org \
    --cc=yukuai3@huawei.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.