]> git.baikalelectronics.ru Git - kernel.git/commit
pnfs/flexfiles: Fix misplaced barrier in nfs4_ff_layout_prepare_ds
authorBaptiste Lepers <baptiste.lepers@gmail.com>
Mon, 6 Sep 2021 01:59:24 +0000 (11:59 +1000)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 03:00:50 +0000 (23:00 -0400)
commit85ba6a02035b6cf6fc3c2d2e9f8ca8d5f7bc4339
tree5fae6438dabc0e85a70006449f3bcbc311fc8e37
parent8852212aa7e4c1cc79d147a3b24c15ee5be0cf72
pnfs/flexfiles: Fix misplaced barrier in nfs4_ff_layout_prepare_ds

_nfs4_pnfs_v3/v4_ds_connect do
   some work
   smp_wmb
   ds->ds_clp = clp;

And nfs4_ff_layout_prepare_ds currently does
   smp_rmb
   if(ds->ds_clp)
      ...

This patch places the smp_rmb after the if. This ensures that following
reads only happen once nfs4_ff_layout_prepare_ds has checked that data
has been properly initialized.

Fixes: a81c063949c42 ("pnfs/flexfiles: Add the FlexFile Layout Driver")
Signed-off-by: Baptiste Lepers <baptiste.lepers@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/flexfilelayout/flexfilelayoutdev.c
fs/nfs/pnfs_nfs.c