lkml.org 
[lkml]   [2022]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 7/7] pmem: fix pmem_do_write() avoid writing to 'np' page
Date
On 2/2/2022 5:28 AM, Christoph Hellwig wrote:
> On Fri, Jan 28, 2022 at 02:31:50PM -0700, Jane Chu wrote:
>> + if (!bad_pmem) {
>> write_pmem(pmem_addr, page, page_off, len);
>> + } else {
>> + rc = pmem_clear_poison(pmem, pmem_off, len);
>> + if (rc == BLK_STS_OK)
>> + write_pmem(pmem_addr, page, page_off, len);
>> + else
>> + pr_warn("%s: failed to clear poison\n",
>> + __func__);
>
> This warning probably needs ratelimiting.

Will do, in case bad hardware is encountered, I can see lots of warnings.

>
> Also this flow looks a little odd. I'd redo the whole function with a
> clear bad_mem case:
>
> if (unlikely(is_bad_pmem(&pmem->bb, sector, len))) {
> blk_status_t rc = pmem_clear_poison(pmem, pmem_off, len);
>
> if (rc != BLK_STS_OK) {
> pr_warn("%s: failed to clear poison\n", __func__);
> return rc;
> }
> }
> flush_dcache_page(page);
> write_pmem(pmem_addr, page, page_off, len);
> return BLK_STS_OK;
>
>

This is much better, thanks for the suggestion!

-jane

\
 
 \ /
  Last update: 2022-02-02 22:31    [W:0.061 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site