Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1944734imm; Thu, 24 May 2018 03:22:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZohPtm/nEaV/Hc5qTtRBrVY5tYKkSGFJpP/Pwo9bqqGWPqkVJQuQ1327Bb84XM5oaxw0HMy X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr6948898plo.106.1527157339301; Thu, 24 May 2018 03:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157339; cv=none; d=google.com; s=arc-20160816; b=wlsQPTYVW3s4asraUVAmzujOcwta2GTybrgIIqXlrw0beuFh0/tE79oy1a9iMC+4LO em3C153xnlVPhpFAbL9RTyGs9G21tDkKUzFbyA+lpUZOT8FuTMxeJkdVTQH4wuO9BwD5 K+T3lxFxfoC1vQuClW/BlvfDw4blIwZc+/NLdofRyk0uf4rpTc3ij3KCQFwzPCD9q2y9 jZirJmDyBS9YhNkx5eYfLfISd47chcbrJlDlT9ud4S94cVR1Sd7qvLqcOqBhMzJUW+o+ KdbARD3uUWptlrvW6x+vm+fryBmjDFiL5CLUd6Cg0NNrz6LyuczmyQrcnVEzFy5X6YJa 3Oew== 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=gV0dbmxXRGEVTR0sqS1Pl6RpAeoUOIXAktHkcFTJzoM=; b=LEo20IhPgw1Xkj7pzohbAdwR4o1Z03pVLgiE9bkWaMDyoOZx1bppBR/5mJ/Zl7Js77 16mLdlfQvVDC7P1UorDhOZbRclnGHiXLZJPvJX01ZA7thACDD6JR4+q+earxqwiK7MEb 5Qacjk1EHFoSb7RtPG7lpYB//K8hcEjHyhBxBAhcCKQHn7KctpllJOaeUWyQUH9/hRXk n8PcV68dt+wVwctKTWQSA1CFRNWD7yyXTvxlhirCRdTKdvPwrz2ocdFN++MMhR9j1Iph rdzzFgb83MCo28uqnGleobKRBfVGQI3d8G3bF1drEPErd1d0Mb1FV3yhx/DVhqGbb7w8 5SyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=odkbXrWp; 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 x17-v6si21304979pfh.354.2018.05.24.03.22.04; Thu, 24 May 2018 03:22:19 -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=odkbXrWp; 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 S1031223AbeEXKDJ (ORCPT + 99 others); Thu, 24 May 2018 06:03:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:51482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031206AbeEXKDC (ORCPT ); Thu, 24 May 2018 06:03:02 -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 8F64F20890; Thu, 24 May 2018 10:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156182; bh=lCwghnH/4hSgY5q1hIra9NwNs68bL72q7VzOoK980QA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=odkbXrWpOhrLltidSVu4CcqY1e5frni7idPTi0/n8hJQuRPNriL6TT/SmTUGBASiQ 3NOZ+kKB/kIcUARhmGiWu8pr4ZqfuqW4LvCs5xRgEFoIiKsHf0r15MDZKffLU/a9rP z7MP956ZJWep/YCJpvA+fmRlWCOBcsmFcaBGL0jg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Sasha Levin Subject: [PATCH 4.16 092/161] staging: lustre: fix bug in osc_enter_cache_try Date: Thu, 24 May 2018 11:38:37 +0200 Message-Id: <20180524093029.439099481@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@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.16-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 @@ -191,7 +191,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 @@ -1530,7 +1530,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) {