From patchwork Wed Nov 17 17:41:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 333501 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAHHfpwR022584 for ; Wed, 17 Nov 2010 17:41:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933709Ab0KQRlu (ORCPT ); Wed, 17 Nov 2010 12:41:50 -0500 Received: from daytona.panasas.com ([67.152.220.89]:15714 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758504Ab0KQRlt (ORCPT ); Wed, 17 Nov 2010 12:41:49 -0500 Received: from fs1.bhalevy.com ([172.17.33.217]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 17 Nov 2010 12:41:48 -0500 From: Benny Halevy To: linux-nfs@vger.kernel.org Cc: Andy Adamson Subject: [PATCH] SQUASHME: pnfs: move synchronize_rcu out side of spin_lock Date: Wed, 17 Nov 2010 19:41:44 +0200 Message-Id: <1290015704-6221-1-git-send-email-bhalevy@panasas.com> X-Mailer: git-send-email 1.7.2.3 X-OriginalArrivalTime: 17 Nov 2010 17:41:48.0653 (UTC) FILETIME=[B5EEF9D0:01CB867E] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Nov 2010 17:41:52 +0000 (UTC) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 559fcce..39c7d9f 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1651,7 +1651,6 @@ pnfs_unhash_deviceid(struct pnfs_deviceid_cache *c, hlist_for_each_entry_rcu(d, n, &c->dc_deviceids[h], de_node) if (!memcmp(&d->de_id, id, sizeof(*id))) { hlist_del_rcu(&d->de_node); - synchronize_rcu(); return d; } @@ -1672,7 +1671,7 @@ pnfs_put_deviceid(struct pnfs_deviceid_cache *c, pnfs_unhash_deviceid(c, &devid->de_id); spin_unlock(&c->dc_lock); - + synchronize_rcu(); c->dc_free_callback(devid); } EXPORT_SYMBOL_GPL(pnfs_put_deviceid); @@ -1686,7 +1685,7 @@ pnfs_delete_deviceid(struct pnfs_deviceid_cache *c, spin_lock(&c->dc_lock); devid = pnfs_unhash_deviceid(c, id); spin_unlock(&c->dc_lock); - + synchronize_rcu(); dprintk("%s [%d]\n", __func__, atomic_read(&devid->de_ref)); if (atomic_dec_and_test(&devid->de_ref)) c->dc_free_callback(devid);