From patchwork Mon Apr 24 05:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13221664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFD30C77B61 for ; Mon, 24 Apr 2023 05:50:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58286900003; Mon, 24 Apr 2023 01:50:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 533886B0085; Mon, 24 Apr 2023 01:50:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D3A16B0087; Mon, 24 Apr 2023 01:50:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 25ED06B0083 for ; Mon, 24 Apr 2023 01:50:20 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E29498012D for ; Mon, 24 Apr 2023 05:50:19 +0000 (UTC) X-FDA: 80715209358.03.178070F Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf18.hostedemail.com (Postfix) with ESMTP id 414CF1C0004 for ; Mon, 24 Apr 2023 05:50:18 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=mv0e7BU3; spf=none (imf18.hostedemail.com: domain of BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682315418; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wb6cWzDzgbU80SKdNhmkiB4WmHIQIndA+4skiI8V8fU=; b=N//4pxpVeAqXU2fQvhbAkpT6kKVToSyzh9/GgRSUbIi/iWnruFylEyP73QrBh0OwZtjN+s upX4ul+XsE2QPcZjaVOtE6LqipAwgBmlo0nV05K2B/w2oqNsK4TpeltWQ9hiKeeu2HFov7 PRmWL/neWVg9lyeBlSBTcco/saE6WqU= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=mv0e7BU3; spf=none (imf18.hostedemail.com: domain of BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682315418; a=rsa-sha256; cv=none; b=gnMOX77i4SdyyNAsx3PEIoahmEuxBRVIEdjl0pSiocaKgaRY1r410wkAEKfQIwAzFNY5A6 vGe67sH/RM0ci5APyl82K4Ps17FQ3U9260V02Qkg2t70rq3llY7gsuL9rO/7xaCx1pIl6t MPzD84N2sVcWSdY2rfsS871NuB4/XvY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=wb6cWzDzgbU80SKdNhmkiB4WmHIQIndA+4skiI8V8fU=; b=mv0e7BU3F7SMyd8eLBhwb+Y0F7 znPgpjqXZ4HeAV1eIpqytPq1qlE2Z6ERAC05IsZSk0Xp26INJjUI7B0wTCifLQvtz95fuUly47A60 DWBGBgzkE0tv+pfytsoMZFOSHTsPvNLSWyjGi17l7Yb0x8t1sAlp/JB/Zj5Jyyvy+kUjDkJLePVzX O53Ty6SpZMoCvI5Ssudo/hWbvHKIdGyYrwRfQhwnxxHPP+bP9bKhPGJlFO0HKjlrXEq6I1qQJAGLY nLg834BQ/F7+Z8S4FjwMYtC8lma6QFFFF2rDDnUUh4ekMBmQJzlfQAYNUFafdB3JEbmYIuoTSWGtp WXUoQW8A==; Received: from [2001:4bb8:189:a74f:e8a5:5f73:6d2:23b8] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pqp5O-00FP43-21; Mon, 24 Apr 2023 05:50:03 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Miklos Szeredi , "Darrick J. Wong" , Andrew Morton , David Howells , Matthew Wilcox , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/17] iomap: assign current->backing_dev_info in iomap_file_buffered_write Date: Mon, 24 Apr 2023 07:49:20 +0200 Message-Id: <20230424054926.26927-12-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230424054926.26927-1-hch@lst.de> References: <20230424054926.26927-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 414CF1C0004 X-Stat-Signature: kchj9ebp7izpezezd4jrq1x7pwzk8t1z X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1682315418-769966 X-HE-Meta: U2FsdGVkX189ZY/Q68a8qaf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BwlttPXIgq0blrL0hjY7DFRBdPs6lVHDXVtSbnLXnMSptTUmggScuN6wXB3ijxRCoTMI02lsqrWbthsvMI7HM40r+dIEg17B7SsLETtkgGS8yIAIwJNpArEHUHpGhTz4mE/SXvffNb2OKjsnUi+1gmCU0OKmRjLriYtTfm+DNppDzD+hNgE9vNQGbu3+Evyrgvz5DRF0vRTFY9ypdoKLUZmsTnJk2cVeUh4j9skaaptsjeHndeIafXPjbkYanCPaH/3o+FvKLUkjfbnnX+ycUu4ZsvW5IE+BTL46srlZ+mWfgpTF2LwLRSwJuGyg5kcDBt6EtrLwo3/13NNkSBwNmkQn3y41UKH7UkuHZfBICRCsXtn/Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Move the assignment to current->backing_dev_info from the callers into iomap_file_buffered_write. Note that zonefs was missing this assignment before. Signed-off-by: Christoph Hellwig --- fs/gfs2/file.c | 3 --- fs/iomap/buffered-io.c | 4 ++++ fs/xfs/xfs_file.c | 5 ----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 8c4fad359ff538..4d88c6080b3e30 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "gfs2.h" @@ -1041,11 +1040,9 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb, goto out_unlock; } - current->backing_dev_info = inode_to_bdi(inode); pagefault_disable(); ret = iomap_file_buffered_write(iocb, from, &gfs2_iomap_ops); pagefault_enable(); - current->backing_dev_info = NULL; if (ret > 0) { iocb->ki_pos += ret; written += ret; diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 2986be63d2bea6..3d5042efda202a 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -3,6 +3,7 @@ * Copyright (C) 2010 Red Hat, Inc. * Copyright (C) 2016-2019 Christoph Hellwig. */ +#include #include #include #include @@ -876,8 +877,11 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, if (iocb->ki_flags & IOCB_NOWAIT) iter.flags |= IOMAP_NOWAIT; + current->backing_dev_info = inode_to_bdi(iter.inode); while ((ret = iomap_iter(&iter, ops)) > 0) iter.processed = iomap_write_iter(&iter, i); + current->backing_dev_info = NULL; + if (iter.pos == iocb->ki_pos) return ret; return iter.pos - iocb->ki_pos; diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 705250f9f90a1b..f5442e689baf15 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -717,9 +716,6 @@ xfs_file_buffered_write( if (ret) goto out; - /* We can write back this queue in page reclaim */ - current->backing_dev_info = inode_to_bdi(inode); - trace_xfs_file_buffered_write(iocb, from); ret = iomap_file_buffered_write(iocb, from, &xfs_buffered_write_iomap_ops); @@ -753,7 +749,6 @@ xfs_file_buffered_write( goto write_retry; } - current->backing_dev_info = NULL; out: if (iolock) xfs_iunlock(ip, iolock);