Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp848345rdb; Mon, 29 Jan 2024 23:32:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1AWqVOgotdD1x68l0JrOKqySnxXZdTveDpFTkrLa9U6RoeCebMdUELzI8s7lCvt3uS6il X-Received: by 2002:a17:902:ce87:b0:1d8:b2f4:28ce with SMTP id f7-20020a170902ce8700b001d8b2f428cemr4230065plg.42.1706599935947; Mon, 29 Jan 2024 23:32:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706599935; cv=pass; d=google.com; s=arc-20160816; b=PAWheAdhw4qUp/Q81x0mdvl+tF19K51ROSQwTxwNebx/1Qr4vuqulp/+rMstNDhAWu L/l7J10wIAuFmoyLUcW2qTFxSTNiG9Mc1wQKp6zNvoqjK/nD76ZODCuDArhnnE2vlq9o K4qgNOS8QrqwleMVUaUEdjtBS1v4j+vZiKQpuPQke8400I0qPygFYlB25adiS5X8HKaQ r+hIonGuJNOlKQ2eWAl/DPc5jBzXwTVN/bJE78ijCggmSUfpcGBTwpR7K9Nw8nmT20xZ C7dlYNDXT2CWQL6m0enXdrnUTg1exnrY66K3177nV2w8VESTArTGMI+r0AtRsP5CMXJ5 pkCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RvFiTSeyZH3jejdjN8UpxpNfKxiu5OCZhfTaYIa/XzE=; fh=fdigxwOS/oYRSgCe2FJEZRlaGceYmajINnEEOpwgjBE=; b=Q9rNMadHN0RkKSDSO4miJ1V02SlXOxtyQ+ufKkkDDuD0jKWnOcozDQfDstX+uTJBdz pjtpWkzT3ZKvUNVoa7lcY696WF/XvQ6+/ROdg2XIM+FMPE8lQPp1yjU4ee6E69mNXXXv mPd5hw8bSWh09nogB5qW8kIYsc3a691vs2Jo9CLTFeJtFmvHNIU2Qz7S4y3ANQ6fKiat v+PQ1hYvXugmII7SbxoeJ2OJA+fL2/6Nvhb21+mZLH5dgPBB8SLnMGRjSzpV5Fh+gtop O3TSVFR2keUv+s5CN9ZdWcwM4TSOjD4KdTWQcy8ya5/msv7i762TR0jfw8VP3JYp8WFX Md7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="shp+Ntp/"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-ext4+bounces-1019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1019-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w7-20020a170902e88700b001d6f183f54csi7027296plg.68.2024.01.29.23.32.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 23:32:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="shp+Ntp/"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-ext4+bounces-1019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1019-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7D128287D9F for ; Tue, 30 Jan 2024 06:13:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99385381D1; Tue, 30 Jan 2024 06:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="shp+Ntp/" X-Original-To: linux-ext4@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0F3B381B6; Tue, 30 Jan 2024 06:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706595202; cv=none; b=nPoyTGiPTtpIoAJX6AHnefrgi4g3SVVUenW/e7JiztfbSEp0TnZc3fgrpntxAajqz0yGVveBbWZ1RoXrI6EurD/8JLnc0js9ss4vobL3x+akuWI6fqie4Et6MPcUdUsZdVm0qA4swcK/zzpjAmUmibqw4GnkuunMXK6vXxowxBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706595202; c=relaxed/simple; bh=zjQ6yf6RzTZyhb7cdTmUi8VVWbtiL5FkYNucL8jcKLA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fq1kLizbARI1Evg8SliAT70zOldtQG/XvFveHI8PcPDbfwUEw1wr2gw2IawtySpLGFn7vQyr67gTyp2ZaTjZzvlTknK17Tw9C8pGHJGbKnVyW7exW5M1cGEFctuscqklZ8b0jFpOpkIMFty049wlVd9eTSnRbfTurNwdSeD5+RA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=shp+Ntp/; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RvFiTSeyZH3jejdjN8UpxpNfKxiu5OCZhfTaYIa/XzE=; b=shp+Ntp/EsobLtw4KNsj9JLvna HuiGD1GN49Se+uyaY8rYbOFOF+iYeQ5zAsskgDaJi9/Vk4jROrugxvWl2ccFrwHGnqTW5OdrC+z7P dHyI8XHw4mS+FC8sxzb7y52/TrEQzBXX4dSxxDB4qlBLOEX0lPipajWT37WrTQEvjZJIeFmHeXWeX av1rTiIyI7TKUumi9cLIelUfjALmQWXwSxc/DhamTvhJA7pn+w9Na3GVinljDCZ7bKdCrJE4BsuYF b8RvP9rcuFJX4i0IRCetOsduYrpWFyJjtzlN7NBhdC5U6BL9DiybdNJQo7+bzhbx8pLKskLF22Gzh rZOqOuKg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUhN1-0000000924z-0TAU; Tue, 30 Jan 2024 06:13:19 +0000 Date: Tue, 30 Jan 2024 06:13:19 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 3/3] ext4: Convert to buffered_write_operations Message-ID: References: <20240130055414.2143959-1-willy@infradead.org> <20240130055414.2143959-4-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240130055414.2143959-4-willy@infradead.org> On Tue, Jan 30, 2024 at 05:54:13AM +0000, Matthew Wilcox (Oracle) wrote: > +++ b/fs/ext4/file.c > @@ -287,16 +287,24 @@ static ssize_t ext4_buffered_write_iter(struct kiocb *iocb, > { > ssize_t ret; > struct inode *inode = file_inode(iocb->ki_filp); > + const struct buffered_write_operations *ops; > > if (iocb->ki_flags & IOCB_NOWAIT) > return -EOPNOTSUPP; > > + if (ext4_inode_journal_mode(inode)) I forgot to commit --amend. This line should have been: + if (ext4_should_journal_data(inode)) > + ops = &ext4_journalled_bw_ops; > + else if (test_opt(inode->i_sb, DELALLOC)) > + ops = &ext4_da_bw_ops; > + else > + ops = &ext4_bw_ops; > + > inode_lock(inode); > ret = ext4_write_checks(iocb, from); > if (ret <= 0) > goto out; > > - ret = generic_perform_write(iocb, from); > + ret = filemap_perform_write(iocb, from, ops); > > out: > inode_unlock(inode);