All of lore.kernel.org
 help / color / mirror / Atom feed
* Limitation in the badblocks routines
@ 2017-11-08  0:27 Verma, Vishal L
  0 siblings, 0 replies; only message in thread
From: Verma, Vishal L @ 2017-11-08  0:27 UTC (permalink / raw)
  To: neilb@suse.com; +Cc: linux-nvdimm@lists.01.org

I think I've found a limitation in the badblocks implementation
(block/badblocks.c), which we now also use for nvdimm badblocks. 

Consider the following operations:

badblocks_set(bb, 32, 1);
badblocks_set(bb, 34, 1);
badblocks_set(bb, 36, 1);

badblocks_show will now correctly report:
32 1
34 1
36 1

Now if I do:
badblocks_set(bb, 32, 12);

Ideally, this should collapse all ranges into a single (32, 12).. But
looks like badblocks_set only merges one set of adjacent mergeable
ranges, and then returns, resulting in:

32 3
36 1

Now if I add the same (32, 12) range again, I get:

32 5

as one more set is merged. And finally after adding (32, 12) one final
time, I get the expected

32 12.

Neil - do you think it will be relatively straightforward to extend
badblocks_set to be aware of multi-overlap ranges like above? I haven't
really looked at the internals of it (I'll take a look tomorrow), but I
wanted to get this out in the meantime.

Thanks,
	-Vishal
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

only message in thread, other threads:[~2017-11-08  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08  0:27 Limitation in the badblocks routines Verma, Vishal L

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.