Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3851523pxv; Mon, 19 Jul 2021 10:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaw/j6NU6rocK6rJiIu9OnFVg4cYaw+ekr8Uc+8ALppPqzHm3hEcQoYIt7u5CNx8hRsonl X-Received: by 2002:a92:2911:: with SMTP id l17mr17507048ilg.263.1626714896323; Mon, 19 Jul 2021 10:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626714896; cv=none; d=google.com; s=arc-20160816; b=tELc5jQNGZVnUnZrkZLyhuVWjx/KGgQINZqqmagGAE0y+4ZixZnOhcex2C080M+p4O Mt+bIsbZoe+y6pH5KUIOMHFXd/bcgf8WC/O7cujR3wdVUuh2/yAg+X4tNBwTmnYtLFcd 4v+3lOKDSHBKRBPWBhbqEi0yBRGB7+QweL5zS50ajadYwX/3LqrbL4DQiyU587OVYfBy purp5ypuFN7VLhImXBVPKwplLvn2OF2Ce2Ba9cUF4LaNAUb3vy0BrnNTcSMxdzvgBFVj 4wOkhFOrHZ7q4F5hRxUXAS1IXqQ3vXXDeP1duAz2jh/jelzCF8E5Oyu/Pod3WoQTcyw9 PFAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bkMD47dgUjA5A6LIVljHWMitAuUc0XlpeBgDp8eG6WE=; b=comMaOlBAUiVwi8+sSxGAZgraIpaFlXzRzrIbTaaLJtUX7oG5tE2iNOJ+Fhqbybizt qrdt3JlLXk7I37JMGniTBrpB0igQMCZMOvhimLnEZJHYSs3AOfzMEfptMoD46+s4gs1O /xNUO9UHFWG2vLpr6xgRjaj8ohRgz2YrRNJvwu5aYQHrtr8RjT4wjYJXdxa8YtVlH2cj aMhWPXGVQqx95pDYXl+I1rVDReW7QMamjCP5MXR6i1I8J0wzsKQQX4RBQpB9QwRr7ld2 gsVqJx8iPxEjxeA/PotUzWVxBgiTPUXw5U5FFIGHajg7VJUPFrc9bGvussk63alh9+sZ /mrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gUUozvM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id az3si11541123jab.111.2021.07.19.10.14.43; Mon, 19 Jul 2021 10:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gUUozvM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351984AbhGSQc2 (ORCPT + 99 others); Mon, 19 Jul 2021 12:32:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:58072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346100AbhGSPQ5 (ORCPT ); Mon, 19 Jul 2021 11:16:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D46C460200; Mon, 19 Jul 2021 15:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710235; bh=6HvT/XvruA45g30KjXZYhixeen6q9eCh5lcEAfjyexw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gUUozvM15bfQryx61gFBlRCD8dMRkhirmmiyBurpb2qhO61pCqEuBwuxJmt3AaJt0 tHza7OPWP2HEwICSDh/0/6APzI67tK/chtqmMrMrCzh9vKFddlH52Ub0zRSfCCxem0 8JoqDX48Xj38Ikfjioy4uJtuOGVbIkCkj4+sOD9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Wilcox , Jeff Layton , Ilya Dryomov , Sasha Levin Subject: [PATCH 5.10 132/243] ceph: remove bogus checks and WARN_ONs from ceph_set_page_dirty Date: Mon, 19 Jul 2021 16:52:41 +0200 Message-Id: <20210719144945.179746621@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Layton [ Upstream commit 22d41cdcd3cfd467a4af074165357fcbea1c37f5 ] The checks for page->mapping are odd, as set_page_dirty is an address_space operation, and I don't see where it would be called on a non-pagecache page. The warning about the page lock also seems bogus. The comment over set_page_dirty() says that it can be called without the page lock in some rare cases. I don't think we want to warn if that's the case. Reported-by: Matthew Wilcox Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- fs/ceph/addr.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 8b0507f69c15..3465ff95cb89 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -78,10 +78,6 @@ static int ceph_set_page_dirty(struct page *page) struct inode *inode; struct ceph_inode_info *ci; struct ceph_snap_context *snapc; - int ret; - - if (unlikely(!mapping)) - return !TestSetPageDirty(page); if (PageDirty(page)) { dout("%p set_page_dirty %p idx %lu -- already dirty\n", @@ -127,11 +123,7 @@ static int ceph_set_page_dirty(struct page *page) page->private = (unsigned long)snapc; SetPagePrivate(page); - ret = __set_page_dirty_nobuffers(page); - WARN_ON(!PageLocked(page)); - WARN_ON(!page->mapping); - - return ret; + return __set_page_dirty_nobuffers(page); } /* -- 2.30.2