From patchwork Tue May 4 15:33:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 430899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86335C433ED for ; Tue, 4 May 2021 15:33:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4010D6115B for ; Tue, 4 May 2021 15:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbhEDPeS (ORCPT ); Tue, 4 May 2021 11:34:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:32810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230112AbhEDPeR (ORCPT ); Tue, 4 May 2021 11:34:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C383A6112F; Tue, 4 May 2021 15:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620142402; bh=5OLQbK1jg3+ANuSrVbLRW6BvwmTY1QUlx+oajrR5rk0=; h=From:To:Cc:Subject:Date:From; b=Pw9xjmSfZI1O7F9UZG8hTgRZzHdZrK3SNSYiFbqAb8eOIU1YudB+ULdf3/NmM60p3 arpmm4O+r9G1d9/Z1bz0trZZ/DTczFiD4vgunj8RVdUbvlYyP7PWxDaiuKy/bXDTji JC1GVwmuCm0SAwC/UzRNQFl3te6uwW+gblA5vmzCAqyO0vVc5s+JuD40onIG7XKjmo p4gtj3w+bYcHjs2TEvJ+7eIraRTNxUWkcSyh+f6g6jy8sitZjevr7wA6DSBGqfXI/U OGuC4OU1EeGB5l4Dvk70sTUWxcqcuTaNQLS7/YWU2XbwgYiq/WA6jo2an0T6zuZ3xd xEc8EEXyqxqKw== From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@gmail.com, Sha Zhengju , Sage Weil , Matthew Wilcox Subject: [PATCH v2] ceph: remove bogus checks and WARN_ONs from ceph_set_page_dirty Date: Tue, 4 May 2021 11:33:20 -0400 Message-Id: <20210504153320.97068-1-jlayton@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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 is 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. Cc: Sha Zhengju Cc: Sage Weil Reported-by: Matthew Wilcox Signed-off-by: Jeff Layton --- 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 b47303b3772a..ecbc0f71e3ab 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -82,10 +82,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", @@ -130,11 +126,7 @@ static int ceph_set_page_dirty(struct page *page) BUG_ON(PagePrivate(page)); attach_page_private(page, snapc); - ret = __set_page_dirty_nobuffers(page); - WARN_ON(!PageLocked(page)); - WARN_ON(!page->mapping); - - return ret; + return __set_page_dirty_nobuffers(page); } /*