From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [PATCH 2/5] new fscache interface to check cache consistency Date: Wed, 04 Sep 2013 19:13:20 +0100 Message-ID: <16226.1378318400@warthog.procyon.org.uk> References: <306cbe63f85921ad40b00e3c7071be19cb6adf04.1375999914.git.milosz@adfin.com> <18832.1378311843@warthog.procyon.org.uk> <18284.1378315570@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Sage Weil , linux-kernel@vger.kernel.org, "linux-fsdevel@vger.kernel.org" , "linux-cachefs@redhat.com" , "Yan, Zheng" , ceph-devel To: Milosz Tanski Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cachefs-bounces@redhat.com Errors-To: linux-cachefs-bounces@redhat.com List-Id: linux-fsdevel.vger.kernel.org Milosz Tanski wrote: > Is it as simple as stick a mutex at the top of the > __fscache_check_consistency function before we try to find the object? You can lock a mutex in a function, but where are you actually going to place the mutex struct? And what other code is going to take it? To do this, you'd have to place the mutex struct in fscache_cookie. The problem is that you have to protect the pointer from fscache_cookie to fscache_object - so placing the mutex in fscache_object doesn't help. David