From patchwork Mon Sep 9 18:28:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milosz Tanski X-Patchwork-Id: 2862671 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4EF4BF43F for ; Mon, 9 Sep 2013 18:29:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 964F72039D for ; Mon, 9 Sep 2013 18:29:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C271220379 for ; Mon, 9 Sep 2013 18:29:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578Ab3IIS3A (ORCPT ); Mon, 9 Sep 2013 14:29:00 -0400 Received: from mail-qa0-f41.google.com ([209.85.216.41]:36772 "EHLO mail-qa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752485Ab3IIS27 (ORCPT ); Mon, 9 Sep 2013 14:28:59 -0400 Received: by mail-qa0-f41.google.com with SMTP id cr7so409548qab.14 for ; Mon, 09 Sep 2013 11:28:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=OwelxMtQhnNJ0H8drn686uOV6FO68x9+8J7jVletZM4=; b=KTina7in+OnXPz4uqs1m1Qx/df4dL57v56ivyx3Prb7qzPHoeVVztO0tVjXzGTWCzx UBCJcypMv6JOQ7lHTx/oehglGYy5lAr5vacXa2kWpFDcaQ4n7n2ZxxvNBBbFDjMkk1mu IlUDrZ5u5d96dAX4u1zIw5C0lOCvSLz6D2D6bZEAcrmpclrvX0YUVWGVIMcjNB2f/IFZ +xWAA5NoDIScCD5c/gpMsrzMVVoVDYmpv7EIsOUiqcSEQlbDDb4HnwwmAHmDmGvn0h5y a/unm8sj9VJUCPxZ9ILMNiUYNNUYrS6Vp8K+fI42BFyMplNAuokQGiR2ZcCDcR/0WXUS M4CQ== X-Gm-Message-State: ALoCoQmOCPNS/TdPM+wag0vbsUjBtUCBBzJClZbERHCovK2V4EYDVToHkTbRhvW2yqXW29fXWU+A X-Received: by 10.224.173.3 with SMTP id n3mr3238323qaz.101.1378751338488; Mon, 09 Sep 2013 11:28:58 -0700 (PDT) Received: from gmail.com ([69.193.178.202]) by mx.google.com with ESMTPSA id a2sm27284663qek.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 11:28:57 -0700 (PDT) Date: Mon, 9 Sep 2013 14:28:57 -0400 From: Milosz Tanski To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, dhowells@redhat.com, zheng.z.yan@intel.com, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fscache: check consistency does not decrement refcount Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __fscache_check_consistency() does not decrement the count of operations active after it finishes in the success case. This leads to a hung tasks on cookie de-registration (commonly in inode eviction). INFO: task kworker/1:2:4214 blocked for more than 120 seconds. kworker/1:2 D ffff880443513fc0 0 4214 2 0x00000000 Workqueue: ceph-msgr con_work [libceph] ... Call Trace: [] ? _raw_spin_unlock_irqrestore+0x16/0x20 [] ? fscache_wait_bit_interruptible+0x30/0x30 [fscache] [] schedule+0x29/0x70 [] fscache_wait_atomic_t+0xe/0x20 [fscache] [] out_of_line_wait_on_atomic_t+0x9f/0xe0 [] ? autoremove_wake_function+0x40/0x40 [] __fscache_relinquish_cookie+0x15c/0x310 [fscache] [] ceph_fscache_unregister_inode_cookie+0x3e/0x50 [ceph] [] ceph_destroy_inode+0x33/0x200 [ceph] [] ? __fsnotify_inode_delete+0xe/0x10 [] destroy_inode+0x3c/0x70 [] evict+0x119/0x1b0 Signed-off-by: Milosz Tanski Acked-by: David Howells --- fs/fscache/cookie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c index 318e843..b2a86e3 100644 --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c @@ -586,7 +586,8 @@ int __fscache_check_consistency(struct fscache_cookie *cookie) fscache_operation_init(op, NULL, NULL); op->flags = FSCACHE_OP_MYTHREAD | - (1 << FSCACHE_OP_WAITING); + (1 << FSCACHE_OP_WAITING) | + (1 << FSCACHE_OP_UNUSE_COOKIE); spin_lock(&cookie->lock);