From patchwork Thu Aug 2 04:18:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 952569 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 41gxl03gNYz9s3x; Thu, 2 Aug 2018 14:19:08 +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 1fl54o-0007Pz-Jb; Thu, 02 Aug 2018 04:19:02 +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 1fl54m-0007Oc-SC for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:19:00 +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 1fl54m-0001wZ-G5 for kernel-team@lists.canonical.com; Thu, 02 Aug 2018 04:19:00 +0000 Received: by mail-pl0-f72.google.com with SMTP id q12-v6so598702pls.13 for ; Wed, 01 Aug 2018 21:19:00 -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=2DUmqACCV8+MnGoNbY0FsedIDF6WIvwZgP+8+ve9IKY=; b=TQaGpF1BPdCBjF7DRXsdxUU7zE3MMZl1XU8mdPCsxH2VxItPV1442rK0lsguqw+LYz 9V0h2sIQ3Xc6b0LhXyZWGbI919kh0W84AteyJp0BN/gdqVsVcAJko7zIyARYy2dgc8Sb 6QE0jx2Wb0HNPXm17KvPsAFRJIC5cQGxW4nZoWiC7W+zjFDCvQrKO63jsy9v1CLD9SgB OkdV/VYJok3rhFWql/X8ek6WEc1ROk7oib11XFQjkr25y/NMivtqSojNnN5ysQjYf1h2 ya0GamiO44hpE8MzmY36u/c+m4iYYBXd/YTa7RqDbSsBqoOi8wjPuTNy1lp8bkDNWtoA 4X/w== X-Gm-Message-State: AOUpUlGUUqepRdBuTcJB/gZqBbWAu2GOoM2FxOQgCcw0l1Qzvd0rWlp3 GfZLAeHPoqeWjVg0CG8EHa5ZQweHLWUW5930bxGilZlutuWrNa103JdgTB0vDZQR2bbXVGJZ8QJ 2qo93ObUcZ8ZI/6ZTqOdLKXqW+JopjrcoflDepBxE4GV0h0NT X-Received: by 2002:a63:4d06:: with SMTP id a6-v6mr1087705pgb.408.1533183539150; Wed, 01 Aug 2018 21:18:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfSs6ncEIACHTMlEAR4FULqFdbZBac4EQvpZD2K3IRJJR/2VGXO1ipZH7MvrTecFx8KHQLVbA== X-Received: by 2002:a63:4d06:: with SMTP id a6-v6mr1087699pgb.408.1533183539022; Wed, 01 Aug 2018 21:18:59 -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.18.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 21:18:58 -0700 (PDT) From: Daniel Axtens To: kernel-team@lists.canonical.com Subject: [SRU T][PATCH 2/6] fscache: Allow cancelled operations to be enqueued Date: Thu, 2 Aug 2018 14:18:46 +1000 Message-Id: <20180802041850.22961-3-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/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 318071aca217..473c529d604c 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -37,7 +37,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) { @@ -402,7 +403,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);