From: Verma, Vishal L <vishal.l.verma(a)intel.com>
Sent: Wednesday, February 27, 2019 10:13 AM
...
> I suppose the new line should not be added, and the line
> if (ent_e_flag(log_new.old_map)) {
> should be changed to
> if (ent_e_flag(log_new.old_map) && !
ent_z_flag(log_new.old_map)) {
> ?
>
Ah yes good catch, I broke my own rule, in that freelist[i].block should
not have flag bits since it is used as is. The freelist has a separate
has_err field to allow for error clearing, and we should be setting
that.
Does the following incremental patch fix it? Let me know and I can send
a new version including it.
Yes, the patch works for me. Thank you!
But, should we really set the has_err field? Here the enry has both
the zere/error flags set. As I understand, this is not an error, because
the UEFI spec says "... both Error and Zero are set to indicate a map entry
in its normal, non-error state".
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 294c48e45e74..1e7c1a66cef8 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -569,7 +569,7 @@ static int btt_freelist_init(struct arena_info
*arena)
* the BTT read-only
*/
if (ent_e_flag(log_new.old_map)) {
- set_e_flag(arena->freelist[i].block);
+ arena->freelist[i].has_err = 1;
ret = arena_clear_freelist_error(arena, i);
if (ret)
dev_err_ratelimited(to_dev(arena),
Thanks,
-- Dexuan