From: Trond Myklebust Date: Thu, 3 Jan 2019 14:17:12 +0000 (-0500) Subject: SUNRPC: Don't allow compiler optimisation of svc_xprt_release_slot() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1602a7b7d33741d0490682e620bb29e96ad684d7;p=linux.git SUNRPC: Don't allow compiler optimisation of svc_xprt_release_slot() Use READ_ONCE() to tell the compiler to not optimse away the read of xprt->xpt_flags in svc_xprt_release_slot(). Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 4eb8fbf2508dc..c3af1aaef551a 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -363,9 +363,13 @@ static void svc_xprt_release_slot(struct svc_rqst *rqstp) static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt) { - if (xprt->xpt_flags & ((1<xpt_flags); + + if (xpt_flags & (BIT(XPT_CONN) | BIT(XPT_CLOSE))) return true; - if (xprt->xpt_flags & ((1<xpt_ops->xpo_has_wspace(xprt) && svc_xprt_slots_in_range(xprt)) return true;