Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1823711imm; Mon, 3 Sep 2018 10:22:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdamA45BRrB1/KBjGrBm/v8EwC39yURfNxbX/g+oBh1HjM8mNYHZNiTns7zFFzap3hcKGzxe X-Received: by 2002:a17:902:7803:: with SMTP id p3-v6mr29396820pll.119.1535995323793; Mon, 03 Sep 2018 10:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995323; cv=none; d=google.com; s=arc-20160816; b=aG5vqJN0r/jKyXk0nAeIVJDFdPmBF1c1AXAQMTpNohIkh1GcrtKi1TSbWxl7S8+0NN unjPE+w8mcEKKXTqqYgOeTrhKhOz0FtaqOI3l/Bhe4Gbj/fSMXmDHBA4NGm2I48zArvT 9NEP6YMkYtVwAg+fdk/Bq4XsTjo7m8A7hgXcq64Ldp7kEsDAbLMAX3C7+eKrvFLksAel k9/09N8EXRSiVysNejGlnRd/7Iac1fAvc7f5tpe1t+2k2XiXGR8AopsGvXXHr+Lzx5su 7HDuf/DiKeBYEbB7ZDU63EQaOrTnvZL2UFyPsUT1nsJTT/x+iKWB3RPEZnYRQCu1ZFet +whg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/65WZKDHEtBv5LAOyWXe0GNPqBMPkSuXJUcWWH+h3Jg=; b=BguQ0lguIkGGGbP714dpwXdfbW3qWZAUVhYxdsEifP3bh1nE8jH4ldVkU0hAXQ98Np kW0xKTjvefRHjB+Zp7yvShPK5Pw/ivZk6hVcl+95WLVd1yqIPz+lmGOE9fUz0CoAl5HN 7zjBTb7u40DgVBkPnW72vsKekJ03qM9yhpMfmIpYWq6LZmS/ky+U805BUDuHyULaQ89h nGpDdoUlxy5l9ezS1g/vRevfa/q1r81G6y/jfjLvgxZvckLCkjt7SZjwpSx9Z9tQELLl s6Lmr6y+bbP2/iGWmj2T5ogK1dteJCVhnQUCB1jGxOuHOzuhwbiHBjPHKiVwYEGRVoiH RK0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si17701026pgk.327.2018.09.03.10.21.49; Mon, 03 Sep 2018 10:22:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730239AbeICVi4 (ORCPT + 99 others); Mon, 3 Sep 2018 17:38:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42924 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727695AbeICVi4 (ORCPT ); Mon, 3 Sep 2018 17:38:56 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ACA96D09; Mon, 3 Sep 2018 17:17:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kiran Kumar Modukuri , David Howells , Sasha Levin Subject: [PATCH 4.14 051/165] fscache: Allow cancelled operations to be enqueued Date: Mon, 3 Sep 2018 18:55:37 +0200 Message-Id: <20180903165657.683495494@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kiran Kumar Modukuri [ Upstream commit d0eb06afe712b7b103b6361f40a9a0c638524669 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/fscache/operation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -66,7 +66,8 @@ void fscache_enqueue_operation(struct fs 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 fscach 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);