Skip to content

Assigning NULL to gfn of dax_direct_access if useless

Huaisheng Ye linux-fsdevel linux-nvdimm linux-s390 lkml nvdimm 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 3 repliesIn review
  2. v13 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4nvdimm/pmem: check the validity of the pointer pfndrivers/nvdimm/pmem.c+2 -10 replies
2/4nvdimm/pmem-dax: check the validity of the pointer pfntools/testing/nvdimm/pmem-dax.c+4 -20 replies
3/4s390/block/dcssblk: check the validity of the pointer pfndrivers/s390/block/dcssblk.c+2 -10 replies
4/4fs/dax: Assign NULL to gfn of dax_direct_access if uselessfs/dax.c+3 -60 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJan Kara
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] Assigning NULL to gfn of dax_direct_access if useless

From: Huaisheng Ye <[email protected]>

Changes since v1 [1]:
* Collect Jan's reviewed-by.
* According to Dan's suggestion, update the unit test infrastructure tools/testing/nvdimm/pmem-dax.c for checking the validity of gfn.

[1]: https://lkml.org/lkml/2018/7/4/81

---

Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable.

So all direct_access need to check the validity of pointer pfn for NULL assignment. If pfn equals to NULL, it doesn't need to calculate its value.

---

Huaisheng Ye (4):
nvdimm/pmem: check the validity of the pointer pfn nvdimm/pmem-dax: check the validity of the pointer pfn s390/block/dcssblk: check the validity of the pointer pfn fs/dax: Assign NULL to gfn of dax_direct_access if useless

 drivers/nvdimm/pmem.c           | 3 ++-
 drivers/s390/block/dcssblk.c    | 3 ++-
 fs/dax.c                        | 9 +++------
 tools/testing/nvdimm/pmem-dax.c | 6 ++++--
 4 files changed, 11 insertions(+), 10 deletions(-)
Signature · 1 line
1.8.3.1