From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4744070470387121117==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] SUNRPC/xprt: fix call_kern.cocci warnings Date: Mon, 14 Mar 2022 11:32:05 +0800 Message-ID: <20220314033205.GA31728@237979dc38b3> In-Reply-To: <202203141129.Lt2sd2kq-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============4744070470387121117== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-kernel(a)vger.kernel.org TO: NeilBrown CC: Trond Myklebust CC: Anna Schumaker CC: Chuck Lever CC: Jakub Kicinski CC: linux-nfs(a)vger.kernel.org CC: netdev(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot net/sunrpc/xprt.c:1690:18-28: ERROR: function xprt_dynamic_alloc_slot calle= d on line 1728 inside lock on line 1722 but uses GFP_KERNEL Find functions that refer to GFP_KERNEL but are called with locks held. Semantic patch information: The proposed change of converting the GFP_KERNEL is not necessarily the correct one. It may be desired to unlock the lock, or to not call the function under the lock in the first place. Generated by: scripts/coccinelle/locks/call_kern.cocci Fixes: a721035477fb ("SUNRPC/xprt: async tasks mustn't block waiting for me= mory") CC: NeilBrown Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git linux-next head: 693486d5f8951780a9bb31f7fe935171a80010e4 commit: a721035477fb5fb8abc738fbe410b07c12af3dc5 [59/66] SUNRPC/xprt: async= tasks mustn't block waiting for memory :::::: branch date: 11 hours ago :::::: commit date: 11 hours ago Please take the patch only if it's a positive warning. Thanks! net/sunrpc/xprt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1687,7 +1687,7 @@ out: static struct rpc_rqst *xprt_dynamic_alloc_slot(struct rpc_xprt *xprt) { struct rpc_rqst *req =3D ERR_PTR(-EAGAIN); - gfp_t gfp_mask =3D GFP_KERNEL; + gfp_t gfp_mask =3D GFP_ATOMIC; = if (xprt->num_reqs >=3D xprt->max_reqs) goto out; --===============4744070470387121117==--