Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754029AbcJDPyU (ORCPT ); Tue, 4 Oct 2016 11:54:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38954 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbcJDPyT (ORCPT ); Tue, 4 Oct 2016 11:54:19 -0400 Date: Tue, 4 Oct 2016 17:54:17 +0200 From: Artem Savkov To: David Howells Cc: linux-cachefs@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Use proper lock in fscache_objlist_config. Message-ID: <20161004155417.GC19785@shodan.usersys.redhat.com> References: <1475588310-10910-1-git-send-email-asavkov@redhat.com> <7737.1475595811@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7737.1475595811@warthog.procyon.org.uk> User-Agent: Mutt/1.7+2 (e5fcfc5f9c2e) (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 04 Oct 2016 15:54:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 722 Lines: 19 On Tue, Oct 04, 2016 at 04:43:31PM +0100, David Howells wrote: > Artem Savkov wrote: > > > fscache_objlist_config doesn't hold rkey->sem when calling user_key_payload, > > that can result in a "suspicious RCU usage" warning. It does hold > > rcu_read_lock, so it either needs to use unprotected rcu_dereference, > > or take rkey->sem instead of rcu_read_lock. > > It shouldn't take key->sem. The RCU lock should be necessary as > user_key_payload() wraps a call to rcu_dereference(). > > Did you encounter a lockdep report or did you visually inspect this? I didn't see a lockdep report for this one, I just assumed it would be the same as with the nfs_idmap_get_key case. -- Regards, Artem