From patchwork Thu Aug 2 04:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 952573 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 41gxl84c4Hz9s2g; Thu, 2 Aug 2018 14:19:16 +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 1fl54x-0007WL-1H; Thu, 02 Aug 2018 04:19:11 +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 1fl54v-0007Ug-0v for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:19:09 +0000 Received: from mail-pg1-f197.google.com ([209.85.215.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fl54u-0001xN-JD for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:19:08 +0000 Received: by mail-pg1-f197.google.com with SMTP id x2-v6so491975pgp.4 for ; Wed, 01 Aug 2018 21:19:08 -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=He2cjvZmP8crA3lw+QUfX1Y6F1lQehK/41EcfY99030=; b=aLTGb7P/iBlWWkaUifIjmbozqKZf30ytj0grVVQCRtlIiJXNt1edaPiLXLmoIGrBP8 kHyp5qmEBXGDjAw9A5Nt2qZa/769H/D46lD1+kitc3OPTAWxRjFuXbj6usoruiYRN2lT lKNaFUEGgH9zqI4zvsoXKeify9HuQNnZWEzyP4rDoxnfjT1Om5co0ZBBBlOX4eZq8NW1 LpL59Lvbz5HnGGfJ2wsos7eJE3iBNtsL7jdiJJ6evNG66KjqhoU492l94ItNvQNgl+7M /370FWqWLJjnaSb0lljhhx4GlhQSBK7erZgJNgIaPuYnhxDB4cPHcycyOKA8AreJhIZP Zc9Q== X-Gm-Message-State: AOUpUlGHVEIaImQVDl8N1mfo+DNhfvTB4oaP4lBWTHdejiqkV1VMGGdk cNdGYIi0eS+cYOsKMkk4XlrIfEzRjUCOC4UCxh7fLdl9oJyxoOF4OI/Ioty30Koj4rNRr0X1yc6 pVIWhngOEE7/OgwMcSwute+nqHiBLrCmkPzZFp3nS20w2OWYV X-Received: by 2002:a17:902:ab95:: with SMTP id f21-v6mr925138plr.264.1533183547273; Wed, 01 Aug 2018 21:19:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdtfaHhnZIU+w9uzPKSVr6WTyNRyfAYnDNcbvOIDVbExWowN+qDqjNyiIM1icijKPJfCHVTGQ== X-Received: by 2002:a17:902:ab95:: with SMTP id f21-v6mr925132plr.264.1533183547139; Wed, 01 Aug 2018 21:19:07 -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 p73-v6sm952509pfk.186.2018.08.01.21.19.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 21:19:06 -0700 (PDT) From: Daniel Axtens To: kernel-team@lists.canonical.com Subject: [SRU T][PATCH 6/6] cachefiles: Wait rather than BUG'ing on "Unexpected object collision" Date: Thu, 2 Aug 2018 14:18:50 +1000 Message-Id: <20180802041850.22961-7-daniel.axtens@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180802041850.22961-1-daniel.axtens@canonical.com> References: <20180802041850.22961-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 beaa2fd6734f..68c2b2ae0ad6 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -199,7 +199,6 @@ wait_for_old_object: printk(KERN_ERR "CacheFiles: Error:" " Unexpected object collision\n"); cachefiles_printk_object(object, xobject); - BUG(); } atomic_inc(&xobject->usage); write_unlock(&cache->active_lock);