Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3889996pxv; Mon, 19 Jul 2021 11:13:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhvf44NiM5Hrz0A7vE70DWtIAlhRyOn/2EyVdEFJzZlcX08r9JeP89oKs+vRUVSSRfLHUc X-Received: by 2002:a17:906:69d7:: with SMTP id g23mr27763981ejs.195.1626718280252; Mon, 19 Jul 2021 11:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626718280; cv=none; d=google.com; s=arc-20160816; b=oMfJD+kDTWINRAmS81dAmjUFeNe+TYGRo1GC6LizQnpua7QEp7oeM574NpjAoZP9js ftkVh/4ysS83UwtbazDwaxAjbYFP5XhLGKSQGXFfMRZZlaS3ICAzNp+Hh6Npxv+yHL6s grqYXBWqPkESbJP4lCEq6DigIrEGFxe4IU1BY0/BepHUJEHyj9aSdKa/BfGcnwFGOQ5u +3HxMM/T7CgDu4UxIjwu+0AZqiVHhaoTUSb/zS+euH1mPJ5K86YjysBoXo+94itbedoy HYzBKjwtR5nWY7OPpawJThDz54uUf6v4+zIoObfjWeMKjAhz2fS4qdv1Ev9lqhu6o942 Ae5w== 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=3ikK6mGqnwxOJ6W9dM7XIvnrYVkH+Oz9AScDaFnNt9c=; b=GiYknMdoUoCuU++H5YKtMr+ZnpqtT2Nkxg9nH14VP3lM0t8zZx55unBnBFy1+TeLXy RUCgKQWWqtwlwYmq7CaqJeQ8ihl+xrmq1rLQpyIh2cZ48bZGSbbKBfUkA9CzKAwKIW6Q N4GMZA7oDH7POKm2Cjn4mnoZ1VcNW2fSzZUtmPem4UKdG/Bj8rAKZChH4bchl79bLdoY dHdgLfmDC09qh+t1FMoi9ygphmsV7cyGItkBVKuwlsV7sNjrCoCHYPkX0UKox9lzpnIX gPiQWx8YsqRtAEGxT7h6l5FDXnSeBTBhZN+03EwGEGcZ5HN+47LEShM4alI+5tJYnmlY xXzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S2RjjKjm; 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 jz27si5405041ejc.439.2021.07.19.11.10.56; Mon, 19 Jul 2021 11:11:20 -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=S2RjjKjm; 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 S1378026AbhGSRZo (ORCPT + 99 others); Mon, 19 Jul 2021 13:25:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:45034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349486AbhGSPpH (ORCPT ); Mon, 19 Jul 2021 11:45:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C02CB61355; Mon, 19 Jul 2021 16:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711920; bh=PisIxenSRs/4tKpO8gET1MYJfXCfcgqgPRZaeMD+0ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2RjjKjmjHkTdVi/P8/1j7riEu7GH9gFoY30QEI/7JQUmyIyudlKTqJt7N7tAQKFT M6Lc76Z8RPUjSBLwSj/FSiyhsnmyN7npMMz+KvlKyEWFv9NDTAPA23erNMXJasCu4K pZzqwPVY6ZV6Lw45FIuxLfjSsFOCBDLgGrAdNJZU= 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.12 154/292] ceph: remove bogus checks and WARN_ONs from ceph_set_page_dirty Date: Mon, 19 Jul 2021 16:53:36 +0200 Message-Id: <20210719144947.549323977@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@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 c000fe338f7e..c54317c10f58 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