From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 23E96ECE58D for ; Wed, 9 Oct 2019 12:51:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE80F20B7C for ; Wed, 9 Oct 2019 12:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730606AbfJIMvf (ORCPT ); Wed, 9 Oct 2019 08:51:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:52332 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729575AbfJIMvf (ORCPT ); Wed, 9 Oct 2019 08:51:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 61D1AB15E; Wed, 9 Oct 2019 12:51:33 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 42CCB1E4851; Wed, 9 Oct 2019 14:51:32 +0200 (CEST) Date: Wed, 9 Oct 2019 14:51:32 +0200 From: Jan Kara To: Matthew Bobrowski Cc: Jan Kara , tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, darrick.wong@oracle.com Subject: Re: [PATCH v4 5/8] ext4: move inode extension/truncate code out from ->iomap_end() callback Message-ID: <20191009125132.GC5050@quack2.suse.cz> References: <20191008112512.GH5078@quack2.suse.cz> <20191009101848.GG2125@poseidon.bobrowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191009101848.GG2125@poseidon.bobrowski.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed 09-10-19 21:18:50, Matthew Bobrowski wrote: > > Just small nits below: > > > > > +static int ext4_handle_inode_extension(struct inode *inode, loff_t offset, > > > + ssize_t written, size_t count) > > > +{ > > > + int ret = 0; > > > > I think both the function and callsites may be slightly simpler if you let > > the function return 'written' or error (not 0 or error). But I'll leave > > that decision upto you. > > Hm, don't we actually need to return 0 for success cases so that > iomap_dio_complete() behaves correctly i.e. increments iocb->ki_pos, > etc? Correct, iomap_dio_complete() expects 0 on success. So if we keep calling ext4_handle_inode_extension() from ->end_io handler, we'd need some specialcasing there and I agree that changing ext4_handle_inode_extension() return convention isn't then very beneficial. If we stop calling ext4_handle_inode_extension() from ->end_io handler (patch 8/8 discussion pending), then the change would be a clear win. Honza -- Jan Kara SUSE Labs, CR