Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2022428imm; Thu, 24 May 2018 04:40:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq5PhvhS+k7uO9BFID5nn1x47f4NXFR7HByB0ULsdgKWKSoHZMmgijn6aME0kHOXB1eSN+P X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr6943351plc.294.1527162041734; Thu, 24 May 2018 04:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527162041; cv=none; d=google.com; s=arc-20160816; b=DAxKRfuA2KDWAioHrtcpZ+tfSqO6YY7LIrwcd6N4DUCAt0SbYgXqr0v7tEq3js+aPT v0GmnKzffcQgGO7xySm9CH94REnAaq53CTTGaWlJ1j5evYuvlhLgIZWXlqGHmi6ubkFq 1d0PmXhCRem4wb5FAP2Yxj9Bxl5p9Gz2j+mC9ouhbKLKqzKjvQ3fFEtGQ4RtZn5pbtuo J87CO+j4SYggQ77Oll5e+9Vb1cZMyaMEK4zJlXOMQlt+fCc7OhEvQ+U54NscyODkFStB t+LKsCKbnDrb3TdSHb11hdfuow1rUfbgQtsitS3AAOCsvqCCwvaVA5tA35osFxwyjKKz iG7A== 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:dkim-signature :arc-authentication-results; bh=UfsnIh6vCDDWxHJRWGPH09y91VtQICg53fQ6Tqyix9A=; b=glh7jK0AC94+Pc4KvmScPFICcKVqLdVSHRYsKSltC795xEaKauSoXewwnUCWcA9GnU jTlpIWFRMbHC580bHQIYvV4OFXu/Vmh9zZzHxlZFnskX/dLbXxsPt/xLyj/SoFtXr9QI Gv3IsSG4vT+J+M2n6OMf/wUSjEM2gSk729jjqdyiSQ5d8kBMJoy2hyhE0HNOj3HvrJ6e rJANy/qqtEvPHB31H9zinhQsLR2lnqM19ha9s7gHS6hcr6eZhvdRKA8WGASdIcJVPyCA 9CLvevHg0vWnpygBWDmhTMYuelANLrbgqXzR4SVgBszkgXOJ45vUYu/oqxEVsPekBfUu Hbpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AMp24uQU; 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 d65-v6si21559828pfj.243.2018.05.24.04.40.27; Thu, 24 May 2018 04:40:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=AMp24uQU; 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 S967296AbeEXJtA (ORCPT + 99 others); Thu, 24 May 2018 05:49:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:35034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967279AbeEXJsw (ORCPT ); Thu, 24 May 2018 05:48:52 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 436AF20870; Thu, 24 May 2018 09:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155331; bh=tGyQu6g3Dq90OTKOnhYn14MmrUCd74NoW18Mcwoqx/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AMp24uQUOH7fkfuxXBs6HaviXDhlSmGCjH14T/ydcOi2ybPKhee7PKzIWl123XmxG lqyjhBVBqgP5EXPqY1t5t6xTpz4pP1k7+FvxDu2AFngC0iyS4I2z5jPFp8xGz2eiUp USMdRSE1qt5AQeF/DhqcFVWjJEdiE9CBzkDOzU1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Sasha Levin Subject: [PATCH 4.9 47/96] staging: lustre: fix bug in osc_enter_cache_try Date: Thu, 24 May 2018 11:38:30 +0200 Message-Id: <20180524093608.182210250@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: NeilBrown [ Upstream commit 2fab9faf9b27298c4536c1c1b14072ab18b8f80b ] The lustre-release patch commit bdc5bb52c554 ("LU-4933 osc: Automatically increase the max_dirty_mb") changed - if (cli->cl_dirty + PAGE_CACHE_SIZE <= cli->cl_dirty_max && + if (cli->cl_dirty_pages < cli->cl_dirty_max_pages && When this patch landed in Linux a couple of years later, it landed as - if (cli->cl_dirty + PAGE_SIZE <= cli->cl_dirty_max && + if (cli->cl_dirty_pages <= cli->cl_dirty_max_pages && which is clearly different ('<=' vs '<'), and allows cl_dirty_pages to increase beyond cl_dirty_max_pages - which causes a latter assertion to fails. Fixes: 3147b268400a ("staging: lustre: osc: Automatically increase the max_dirty_mb") Signed-off-by: NeilBrown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/include/obd.h | 2 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -253,7 +253,7 @@ struct client_obd { struct sptlrpc_flavor cl_flvr_mgc; /* fixed flavor of mgc->mgs */ /* the grant values are protected by loi_list_lock below */ - unsigned long cl_dirty_pages; /* all _dirty_ in pahges */ + unsigned long cl_dirty_pages; /* all _dirty_ in pages */ unsigned long cl_dirty_max_pages; /* allowed w/o rpc */ unsigned long cl_dirty_transit; /* dirty synchronous */ unsigned long cl_avail_grant; /* bytes of credit for ost */ --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -1542,7 +1542,7 @@ static int osc_enter_cache_try(struct cl if (rc < 0) return 0; - if (cli->cl_dirty_pages <= cli->cl_dirty_max_pages && + if (cli->cl_dirty_pages < cli->cl_dirty_max_pages && atomic_long_read(&obd_dirty_pages) + 1 <= obd_max_dirty_pages) { osc_consume_write_grant(cli, &oap->oap_brw_page); if (transient) {