* [PATCH] btrfs: Fix BUG_ON condition in scrub_setup_recheck_block()
@ 2016-04-30 1:33 Ashish Samant
2016-04-30 16:33 ` Sanidhya Solanki
2016-05-02 9:39 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Ashish Samant @ 2016-04-30 1:33 UTC (permalink / raw)
To: linux-btrfs
pagev array in scrub_block{} is of size SCRUB_MAX_PAGES_PER_BLOCK.
page_index should be checked with the same to trigger BUG_ON().
Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
---
fs/btrfs/scrub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 4678f03..376a6dd 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1350,7 +1350,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
recover->bbio = bbio;
recover->map_length = mapped_length;
- BUG_ON(page_index >= SCRUB_PAGES_PER_RD_BIO);
+ BUG_ON(page_index >= SCRUB_MAX_PAGES_PER_BLOCK);
nmirrors = min(scrub_nr_raid_mirrors(bbio), BTRFS_MAX_MIRRORS);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: Fix BUG_ON condition in scrub_setup_recheck_block()
2016-04-30 1:33 [PATCH] btrfs: Fix BUG_ON condition in scrub_setup_recheck_block() Ashish Samant
@ 2016-04-30 16:33 ` Sanidhya Solanki
2016-05-02 9:39 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Sanidhya Solanki @ 2016-04-30 16:33 UTC (permalink / raw)
To: Ashish Samant; +Cc: linux-btrfs-owner
On Fri, 29 Apr 2016 18:33:59 -0700
Ashish Samant <ashish.samant@oracle.com> wrote:
> pagev array in scrub_block{} is of size SCRUB_MAX_PAGES_PER_BLOCK.
> page_index should be checked with the same to trigger BUG_ON().
>
> Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
> ---
> fs/btrfs/scrub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 4678f03..376a6dd 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -1350,7 +1350,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
> recover->bbio = bbio;
> recover->map_length = mapped_length;
>
> - BUG_ON(page_index >= SCRUB_PAGES_PER_RD_BIO);
> + BUG_ON(page_index >= SCRUB_MAX_PAGES_PER_BLOCK);
>
> nmirrors = min(scrub_nr_raid_mirrors(bbio), BTRFS_MAX_MIRRORS);
>
Hello
I am trying to implement a user-space IOCTL option to change the RAID Stripe Size.
I have run into an issue in the code included here, specifically in line 64 of scrub.c.
#define SCRUB_MAX_PAGES_PER_BLOCK 16 /* 64k per node/leaf/sector */
This line should become a user-space variable if SCRUB_MAX_PAGES_PER_BLOCK is
related in any way to the definition of BTrFS Stripe Length (defined in
volume.h) being equal to a product of Super_blk and RAID Stripe Length, as it was
before mid-December before the patch
"http://article.gmane.org/gmane.comp.file-systems.btrfs/51221/" modified it. If
SCRUB_MAX_PAGES_PER_BLOCK is related to Super_blk, then it too will need to be
changed from a macro to something that is runtime configurable.
Could those more familiar with the code base let me know.
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: Fix BUG_ON condition in scrub_setup_recheck_block()
2016-04-30 1:33 [PATCH] btrfs: Fix BUG_ON condition in scrub_setup_recheck_block() Ashish Samant
2016-04-30 16:33 ` Sanidhya Solanki
@ 2016-05-02 9:39 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2016-05-02 9:39 UTC (permalink / raw)
To: Ashish Samant; +Cc: linux-btrfs
On Fri, Apr 29, 2016 at 06:33:59PM -0700, Ashish Samant wrote:
> pagev array in scrub_block{} is of size SCRUB_MAX_PAGES_PER_BLOCK.
> page_index should be checked with the same to trigger BUG_ON().
>
> Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-04 22:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-30 1:33 [PATCH] btrfs: Fix BUG_ON condition in scrub_setup_recheck_block() Ashish Samant
2016-04-30 16:33 ` Sanidhya Solanki
2016-05-02 9:39 ` David Sterba
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.