From patchwork Thu Aug 2 04:17:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 952555 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 41gxjc2KFjz9s82; Thu, 2 Aug 2018 14:17:56 +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 1fl53b-0006um-CC; Thu, 02 Aug 2018 04:17:47 +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 1fl53Z-0006uK-Mf for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:17:45 +0000 Received: from mail-pg1-f200.google.com ([209.85.215.200]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fl53Z-0001s0-BG for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:17:45 +0000 Received: by mail-pg1-f200.google.com with SMTP id w23-v6so491859pgv.1 for ; Wed, 01 Aug 2018 21:17:45 -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=GYLMuzmmVwmDwjpDFtVBI6RZD3T1PksqDo6aDHTCN2w=; b=nweTYRD1ltYYtlHwiqaHH5RzueRu+SEDSCy9fvVGlx0qtZ7Ezeld89GqUvqEeWakY/ 4qUXMgP+nLZYCku908xaXcFcRSxub/wPD90PU+5dY9XUKOATNNvxo4C6mQ1MP6pBc7b9 rkMd5g850fr08QR+X1KHuQ+GihYE1iYNR1GwcLR2VCReo95RveIJUDbS8o+XfhsCJnFu SLlyUakpkLm4go/8cqrG9SVl0N2HHIiiqDCjv9ZSs3iZL3p5DxOqj10b1fgSHHgDaVW/ ir6XxFVvR2g65C9nCYFIHFwO4tW9O6BT5M2QWlXDK4SeglbpaMEOh7NWPnmYE9/eCgD4 sqMA== X-Gm-Message-State: AOUpUlGbUHI+dsXs6uIHSnGcnPPttMZQa1vf7LVsLR+w3urkRDPBu9z5 oLwqU07zrWoOXxzpIy4UHis46x0GinOTiNIStvKsHwloD5lhhgIJ8EmRrEczgDTJRFwfYgWoplk J5YWAvLxWqM4InSDMsDU8qLDyU9/GcCOcJmRDoWGa3+4nYHQZ X-Received: by 2002:a63:5c7:: with SMTP id 190-v6mr1043618pgf.385.1533183464061; Wed, 01 Aug 2018 21:17:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdg3d+IMuvX3OUtKDPFreO4RjVktB8CQIc6tYnRUVn+sOGreBFC0k0Keh2OpVjo4mxpjc8QjQ== X-Received: by 2002:a63:5c7:: with SMTP id 190-v6mr1043615pgf.385.1533183463946; Wed, 01 Aug 2018 21:17:43 -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.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 21:17:43 -0700 (PDT) From: Daniel Axtens To: kernel-team@lists.canonical.com Subject: [SRU B][PATCH 2/6] fscache: Allow cancelled operations to be enqueued Date: Thu, 2 Aug 2018 14:17:30 +1000 Message-Id: <20180802041734.22518-3-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/1774336 Alter the state-check assertion in fscache_enqueue_operation() to allow cancelled operations to be given processing time so they can be cleaned up. Also fix a debugging statement that was requiring such operations to have an object assigned. Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem") Reported-by: Kiran Kumar Modukuri Signed-off-by: David Howells (cherry picked from commit d0eb06afe712b7b103b6361f40a9a0c638524669) Signed-off-by: Daniel Axtens --- fs/fscache/operation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index de67745e1cd7..77946d6f617d 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -66,7 +66,8 @@ void fscache_enqueue_operation(struct fscache_operation *op) ASSERT(op->processor != NULL); ASSERT(fscache_object_is_available(op->object)); ASSERTCMP(atomic_read(&op->usage), >, 0); - ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS); + ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS, + op->state, ==, FSCACHE_OP_ST_CANCELLED); fscache_stat(&fscache_n_op_enqueue); switch (op->flags & FSCACHE_OP_TYPE) { @@ -481,7 +482,8 @@ void fscache_put_operation(struct fscache_operation *op) struct fscache_cache *cache; _enter("{OBJ%x OP%x,%d}", - op->object->debug_id, op->debug_id, atomic_read(&op->usage)); + op->object ? op->object->debug_id : 0, + op->debug_id, atomic_read(&op->usage)); ASSERTCMP(atomic_read(&op->usage), >, 0);