* [PATCH] Btrfs: update scrub_parity to use u64 stripe_len
@ 2017-04-03 20:45 Liu Bo
2017-04-05 12:40 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Liu Bo @ 2017-04-03 20:45 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Commit 3d8da6781760 ("Btrfs: fix divide error upon chunk's stripe_len")
changed stripe_len in struct map_lookup to u64, but didn't update
stripe_len in struct scrub_parity.
This updates the type and switches to div64_u64_rem to match u64 divisor.
Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
fs/btrfs/scrub.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index b9525ca..fab351c 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -140,7 +140,7 @@ struct scrub_parity {
int nsectors;
- int stripe_len;
+ u64 stripe_len;
atomic_t refs;
@@ -2449,7 +2449,7 @@ static inline void __scrub_mark_bitmap(struct scrub_parity *sparity,
unsigned long *bitmap,
u64 start, u64 len)
{
- u32 offset;
+ u64 offset;
int nsectors;
int sectorsize = sparity->sctx->fs_info->sectorsize;
@@ -2461,7 +2461,7 @@ static inline void __scrub_mark_bitmap(struct scrub_parity *sparity,
}
start -= sparity->logic_start;
- start = div_u64_rem(start, sparity->stripe_len, &offset);
+ start = div64_u64_rem(start, sparity->stripe_len, &offset);
offset /= sectorsize;
nsectors = (int)len / sectorsize;
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: update scrub_parity to use u64 stripe_len
2017-04-03 20:45 [PATCH] Btrfs: update scrub_parity to use u64 stripe_len Liu Bo
@ 2017-04-05 12:40 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2017-04-05 12:40 UTC (permalink / raw)
To: Liu Bo; +Cc: linux-btrfs, David Sterba
On Mon, Apr 03, 2017 at 01:45:33PM -0700, Liu Bo wrote:
> Commit 3d8da6781760 ("Btrfs: fix divide error upon chunk's stripe_len")
> changed stripe_len in struct map_lookup to u64, but didn't update
> stripe_len in struct scrub_parity.
>
> This updates the type and switches to div64_u64_rem to match u64 divisor.
>
> Cc: David Sterba <dsterba@suse.cz>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-05 12:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-03 20:45 [PATCH] Btrfs: update scrub_parity to use u64 stripe_len Liu Bo
2017-04-05 12:40 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).