From patchwork Thu Aug 2 04:18:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 952566 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 41gxkP3wWvz9s2g; Thu, 2 Aug 2018 14:18:37 +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 1fl54I-0007HJ-Ql; Thu, 02 Aug 2018 04:18:30 +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 1fl54H-0007Ft-A3 for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:18:29 +0000 Received: from mail-pl0-f69.google.com ([209.85.160.69]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fl54G-0001v5-UF for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:18:29 +0000 Received: by mail-pl0-f69.google.com with SMTP id j1-v6so582406pld.23 for ; Wed, 01 Aug 2018 21:18:28 -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=B1uwI4kdr+rd+Q2XPabacc5alKmpqMPXIebQsp0KEHg=; b=i+TDRNCEQovGQJLoRPxRe90wOyUgBLf6fR82llMGl9OkrWNWjv6aBoxuN1lLlKunUd BQp+AQP+d4vTXdHRFbFg9morniiTfMh7T1Qa1+xxPYDgWyw8Mat9W/sjemLHN3cKSFzL QOnwDZU6aXH5aq+oIgxyyzACwLDv9wLbt9nN1HsN3WxXtMHpZE2RgNTRbqGL5GPT2aXs jHNoMEJWaneKVQY43tiDxxZHNyS6NIYfuSUsFtfgIiZEpDLXwzTCQK9gPD+D5r4r/AbL EymdKvOuaJwKUKAq0VFiXpuSNbY058RlD2wgVObQjmTwD+uR2gsTpdR6pfaFXCRrVYsn NBwQ== X-Gm-Message-State: AOUpUlF1HyzOBad4+5CZW3e0D2/cfGy13ERqmBUj+S5hQbq/QQHL7qbw wBgGYYC/Tg37SYvur+GIUFYpLF3N2mtRytBb/s8t2nzpgBTyw7RLXRiUUbSQn1Sobsqz6mrVJhF 7nrD0Afs+gS5vwpxk/YYL6V0L4mz8epaMi12fY+B7LTfgw6rE X-Received: by 2002:a63:5a5e:: with SMTP id k30-v6mr1115014pgm.123.1533183507654; Wed, 01 Aug 2018 21:18:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeOZ6Ct8etMoO7UEGpyS64Zkbx2RMZjJAxR0GUDCsgMb25ErPAUsnKlxDqEqnXHKWKSifDlzQ== X-Received: by 2002:a63:5a5e:: with SMTP id k30-v6mr1115009pgm.123.1533183507522; Wed, 01 Aug 2018 21:18:27 -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-v6sm639186pgd.77.2018.08.01.21.18.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 21:18:27 -0700 (PDT) From: Daniel Axtens To: kernel-team@lists.canonical.com Subject: [SRU X][PATCH 6/6] cachefiles: Wait rather than BUG'ing on "Unexpected object collision" Date: Thu, 2 Aug 2018 14:18:10 +1000 Message-Id: <20180802041810.22748-7-daniel.axtens@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180802041810.22748-1-daniel.axtens@canonical.com> References: <20180802041810.22748-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 2bb1bae8d3bc..2cd5b7ac3613 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -196,7 +196,6 @@ wait_for_old_object: 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);