From patchwork Thu Aug 2 04:17:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 952559 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41gxjl0k3Kz9rxx; Thu, 2 Aug 2018 14:18:03 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fl53k-000729-By; Thu, 02 Aug 2018 04:17:56 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fl53h-0006zN-Lb for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:17:53 +0000 Received: from mail-pl0-f72.google.com ([209.85.160.72]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fl53h-0001sP-46 for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:17:53 +0000 Received: by mail-pl0-f72.google.com with SMTP id d10-v6so583037pll.22 for ; Wed, 01 Aug 2018 21:17:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=xAFDUUaaZ1Xeh72MpxjaEtJj8NdcqdJbt/q6ar7iQOk=; b=AAZgyUjQw/vLG+FENKyIAUX56CHL9ikVKBwVoPiCPfcJP+GVI20DCe2n5VDV59yb5/ NfOo0NmGYRS11rYVZVkNSSDAh56ncF6ziDwDUho3TSKpfsoKvCRkUalJ/umlNXGKnlNd Cmbj58P+UlNmgvaIBosf550YLoq5nDKtpxrVWsQ2FuUGhAg8eqkuZZi7ePo7DpNjWsMW kjJGafzPqdPyU7KHqLfA2417egWfF2fPoFuJyOWIw9QGQDeCxp1IGE24HwI6AdtUfv62 HN8/dW/zT14jt803PAUZLuTWVc5GSkAwhRJS6Mc4+OlVnTaNNiqFUsO3Fcs97kACJCNJ nhjg== X-Gm-Message-State: AOUpUlEY8YHpcFaptL5+3Fk6P5UMKJhCP61Cr8XFWMXHCVbiohzU5vl3 3QX9GBuCylgohOpM/ZIEVnwA+yL5OJtBWiounDgysIBVOWnTPn2L4Vii+L3KJBmYXu2oiMSGv0j XVyZI5LNfqolWeIe8Dopt3IbrIj5FFdCg6rJmLo0VNj/z/WDo X-Received: by 2002:a62:411a:: with SMTP id o26-v6mr1169841pfa.111.1533183471809; Wed, 01 Aug 2018 21:17:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd6W3fDXbN4YiPlqWTjJhhQqA8jLlD6InQgBUKxXr0iHUKl1xMmzpDs9Cchbu2+ijtYXDCoDQ== X-Received: by 2002:a62:411a:: with SMTP id o26-v6mr1169834pfa.111.1533183471675; Wed, 01 Aug 2018 21:17:51 -0700 (PDT) Received: from localhost.localdomain (124-171-193-200.dyn.iinet.net.au. [124.171.193.200]) by smtp.gmail.com with ESMTPSA id t186-v6sm637440pgd.77.2018.08.01.21.17.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 21:17:51 -0700 (PDT) From: Daniel Axtens To: kernel-team@lists.canonical.com Subject: [SRU B][PATCH 6/6] cachefiles: Wait rather than BUG'ing on "Unexpected object collision" Date: Thu, 2 Aug 2018 14:17:34 +1000 Message-Id: <20180802041734.22518-7-daniel.axtens@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180802041734.22518-1-daniel.axtens@canonical.com> References: <20180802041734.22518-1-daniel.axtens@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kiran Kumar Modukuri BugLink: https://bugs.launchpad.net/bugs/1776254 If we meet a conflicting object that is marked FSCACHE_OBJECT_IS_LIVE in the active object tree, we have been emitting a BUG after logging information about it and the new object. Instead, we should wait for the CACHEFILES_OBJECT_ACTIVE flag to be cleared on the old object (or return an error). The ACTIVE flag should be cleared after it has been removed from the active object tree. A timeout of 60s is used in the wait, so we shouldn't be able to get stuck there. Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem") Signed-off-by: Kiran Kumar Modukuri Signed-off-by: David Howells (cherry picked from commit c2412ac45a8f8f1cd582723c1a139608694d410d) Signed-off-by: Daniel Axtens --- fs/cachefiles/namei.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 6c9758ec8cef..cd85cf2162ff 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -197,7 +197,6 @@ static int cachefiles_mark_object_active(struct cachefiles_cache *cache, pr_err("\n"); pr_err("Error: Unexpected object collision\n"); cachefiles_printk_object(object, xobject); - BUG(); } atomic_inc(&xobject->usage); write_unlock(&cache->active_lock);