Commit 39a5201a authored by Trond Myklebust's avatar Trond Myklebust

NFSv4/pnfs: Fix barriers in nfs4_mark_deviceid_unavailable()

Fix the memory barriers in nfs4_mark_deviceid_unavailable() and
nfs4_test_deviceid_unavailable().
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 762bb7e9
...@@ -287,7 +287,9 @@ void ...@@ -287,7 +287,9 @@ void
nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node) nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node)
{ {
node->timestamp_unavailable = jiffies; node->timestamp_unavailable = jiffies;
smp_mb__before_atomic();
set_bit(NFS_DEVICEID_UNAVAILABLE, &node->flags); set_bit(NFS_DEVICEID_UNAVAILABLE, &node->flags);
smp_mb__after_atomic();
} }
EXPORT_SYMBOL_GPL(nfs4_mark_deviceid_unavailable); EXPORT_SYMBOL_GPL(nfs4_mark_deviceid_unavailable);
...@@ -302,6 +304,7 @@ nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node) ...@@ -302,6 +304,7 @@ nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node)
if (time_in_range(node->timestamp_unavailable, start, end)) if (time_in_range(node->timestamp_unavailable, start, end))
return true; return true;
clear_bit(NFS_DEVICEID_UNAVAILABLE, &node->flags); clear_bit(NFS_DEVICEID_UNAVAILABLE, &node->flags);
smp_mb__after_atomic();
} }
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment