Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1979013imm; Thu, 24 May 2018 03:58:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZobnhVuS/XFMiSXdigdWDsoIrpw0u8koLg2w8cCiXF7PI6LrvpKrdsbmxacRVT5Vu0BH7R6 X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr6748267pld.29.1527159481325; Thu, 24 May 2018 03:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159481; cv=none; d=google.com; s=arc-20160816; b=GtrKIMQl73P4WBN5hZODfd/JXF76789rkUSSvfltMtWRPegzs4r9daDE8OMEo9DbVk jZBVZKP+9tY61ShpthYd2LPfU5tM98zSxsV1kjPOI5YNpvNJoCwsAJjwxESloAl9yARI txpXwoBEeCi+T6NpOv1tYJrNNlHHTqY2KJgs9hSd0ufQMdcYKAA2255gua+r07ktu476 OBI3R96UzBtLF4bhfdY4ZxCOIZ6KBzyNn1V/kvXHoQ+BIYQoGIEDCszz5+VYaw8wH1AI eMhlzzx1EPw3Hm8EcASKA6HxUL48OF4RDWVSE9HuDmAh7YUPSaSgj7E+ErKB9c2xC+W8 GIvQ== 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=MBrwpTyzXemIviL2VHOgEwFiTL5xq8YiOiEWde1ybWI=; b=u7ui+XaewF2XifP5LqV/nBqv4cVOoC87MIUbxjSM9fyhMAYL2DYkSnUjYY9CDWMu96 kWLoQd+FGikPGAje2nCT1yH7hbkYyqN0ikv+uKv/FMFyLlKRP9gmQQybcw/V/tMXygHU m4ecZTH3gxZA2mjpfvTloCf7ix99iHS7eqvVj6UUOI5L19PaYYK8O4pn39TZ1N4igoLi TmmnY6iraJ2gbxdSyqkhxlE80zCUdy/G9MvfhiNrPzOitLzKzn0bL0SPvVvFKOWu1RVJ bW1DHs7Pa21cFIxO+h6C0JJOGZhAfEnyJN9paTrgCT3RTzCCnEy933qboxNnSmQPRhpY irEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E6+nVaTL; 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 x61-v6si20483151plb.560.2018.05.24.03.57.46; Thu, 24 May 2018 03:58:01 -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=E6+nVaTL; 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 S1032682AbeEXKzd (ORCPT + 99 others); Thu, 24 May 2018 06:55:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:36442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030314AbeEXJ4f (ORCPT ); Thu, 24 May 2018 05:56:35 -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 E3DEA20891; Thu, 24 May 2018 09:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155795; bh=LB12DI6ueLQYdm/BPszLxUD4gYNsGeSBSz/NC6QkqvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6+nVaTLMR3+4MxDC9sS21yT9no+H58kBi1U9oatDz+sHovZt74+EM2Cu4RUBRfCu VNMfFB917htLqfT2rlv2W2iPQ70CbUdc2XGExF/oKU6Gxa+yOqwRnyMYmms2FMfxu4 7pRFXfBHSYqDAcntPmsGADY6Tnf5CwyfQyPxUxww= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Sasha Levin Subject: [PATCH 4.14 086/165] staging: lustre: fix bug in osc_enter_cache_try Date: Thu, 24 May 2018 11:38:12 +0200 Message-Id: <20180524093625.495660379@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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: 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 @@ -190,7 +190,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 @@ -1528,7 +1528,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) {