Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp853344ybl; Fri, 6 Dec 2019 07:17:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwMZk36Ri0gOVpfe5ql8pA4u3bnOdzyehOBKYwsuswIzxweMzrzSveow9ygezGsSuWAekz8 X-Received: by 2002:aca:fc06:: with SMTP id a6mr6404155oii.12.1575645463524; Fri, 06 Dec 2019 07:17:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575645463; cv=none; d=google.com; s=arc-20160816; b=Cl2PvDHrBuT0VfTS9mFkmSuZc9N/92MuXfx4jGZv73/dXgtukA3jkLl2GPLwwtrGMM mlaInWelzffK2pzntEpOAF8H+lWieHWWg5HMXzgu+k9VA27+rKUdPdo7VYyMvTw0IbWy GrtK2A0C7vgdtRxIke8s3O1Hq6Qja8My9BSGwICq1TNMAMByDbnZNHM2nVeTWLyRnJm9 Qy8m80ZKmmI3vPCwdwu/4sYMBkNKTj4pD2UX9RSek1g9GzI5/WKtItqKQ7SZV2Z0R3LT XcbDszP6nNSXaLftoTw8Usa0tHH/if4ABr7it5bGkspnGvy5tX3s3IKTiS5NbHQ4RQvh mGBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6GWdj6y1nIV1eqL/pgj2JGP5rsvKIeTR5YWuhE4vOTY=; b=Ikks2LQzsBQI5bsFgrDJF+fI704aND6lmCvvVYf1907FWk/dH0jN98D90tjJBlNmhV 61/jpP7Q3Mp7aH8WLPYIXc8CtHKxMnHnE05qfAtv8a1vu3vZDZ8xOCobAC38zYYPoeu/ +TXsfP67hS9C0g2CSh4BL8opw7IAm3M5zuOloMGkJTXZ4VN7EL92lqEV9uYMSU7V6rwH BSagg0PDEJJCzlJttJ3dSXXebLqorJbVWW4zw85MqxIilNsVy2dr9NnvHrBl2VxeKUh5 gYUt4EvRpfD2UZ/LkHywL5FAWz5ln7YIogh5SA8kBq6gK4e/xOa7aBtEbQCywfg0/l9w YwRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PVlSO2YV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si6531983oto.91.2019.12.06.07.17.29; Fri, 06 Dec 2019 07:17:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PVlSO2YV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726284AbfLFPQ4 (ORCPT + 99 others); Fri, 6 Dec 2019 10:16:56 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40508 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbfLFPQz (ORCPT ); Fri, 6 Dec 2019 10:16:55 -0500 Received: by mail-pg1-f195.google.com with SMTP id k25so3447916pgt.7; Fri, 06 Dec 2019 07:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6GWdj6y1nIV1eqL/pgj2JGP5rsvKIeTR5YWuhE4vOTY=; b=PVlSO2YVN3FeJTHTFmDpe1abRzd3fIG/Wb/SlhKPEvqxWzPRmvzhmwRWJ2DroUirAe R68I9pxVWm0rDrRh3snMBO/mf3UKsVQ7YbfY38rS1+BUogpEjp49LFzgc0p3dB1sGIkp oL3oZpD48wqhyfh+gIvqhPUJ3BKi03PwX/BQRZLGt2K6o1UxgUfPKNJhx/yPHa6zF7Dw xf6W1sQazT+ip4sj92f+SOnfPFsEy0VL2FApQVupSSrB8RREvhBpEWBtxj8Xaktef4qA iwCeHBVsofPrSR64f4sg698v5gs8DmlY+41jQs9YubNvqfRjiLtqUgb7sNcBH9Gtju0e IeNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6GWdj6y1nIV1eqL/pgj2JGP5rsvKIeTR5YWuhE4vOTY=; b=uGzadxNB3O1V0HonD6kjpTlh6Y2dajeKDOmchfzI+mc8qPFKq8VAdQudm44T7X6Wl6 nuo3QtnEz1ogAnMF51vcjETbkhhr3FSuNNRzJCZZbPD8kf0T68kdE5Lp7a9uY6KV2zNi 5TXwraKVb1S4PsZjEPX9z9N99yA7PqIINPkWazOJICT39Umhe5sMWwMhkJ+NVk/6jKhM RpT+SH0K572c6VdxHEGFx+4qtpykaslxfA/EThLoKxhbEZ6RxMnl24y7K9qPlwAhc7ap N1dgHc4C4n1lX+vlwdundgm+3hOXnQ/tc5KUZf+V4nUEEKLvo0WHd1qzHjz1Pj6aVGCf 22bQ== X-Gm-Message-State: APjAAAWp6G+gb1mXJYjjwY5bpyjfnPIO40ucdxFh2MTVoHd29F45j9iz BXeNHLAECTcoepT7NrpuRYj9vbWbzf4= X-Received: by 2002:a65:49ca:: with SMTP id t10mr4109186pgs.37.1575645414671; Fri, 06 Dec 2019 07:16:54 -0800 (PST) Received: from localhost.localdomain ([2402:3a80:13a2:f129:b905:c312:4008:2416]) by smtp.gmail.com with ESMTPSA id o19sm5859347pjr.2.2019.12.06.07.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 07:16:54 -0800 (PST) From: madhuparnabhowmik04@gmail.com To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, joel@joelfernandes.org Cc: linux-nfs@vger.kernel.org, rcu@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, Madhuparna Bhowmik Subject: [PATCH 2/2] fs: nfs: dir.c: Fix sparse error Date: Fri, 6 Dec 2019 20:46:40 +0530 Message-Id: <20191206151640.10966-1-madhuparnabhowmik04@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madhuparna Bhowmik This patch fixes the following errors: fs/nfs/dir.c:2353:14: error: incompatible types in comparison expression (different address spaces): fs/nfs/dir.c:2353:14: struct list_head [noderef] * fs/nfs/dir.c:2353:14: struct list_head * caused due to directly accessing the prev pointer of a RCU protected list. Accessing the pointer using the macro list_prev_rcu() fixes this error. Signed-off-by: Madhuparna Bhowmik --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index e180033e35cf..2035254cc283 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2350,7 +2350,7 @@ static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cre rcu_read_lock(); if (nfsi->cache_validity & NFS_INO_INVALID_ACCESS) goto out; - lh = rcu_dereference(nfsi->access_cache_entry_lru.prev); + lh = rcu_dereference(list_prev_rcu(&nfsi->access_cache_entry_lru)); cache = list_entry(lh, struct nfs_access_entry, lru); if (lh == &nfsi->access_cache_entry_lru || cred != cache->cred) -- 2.17.1