Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp887094ybp; Wed, 9 Oct 2019 05:52:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeJkikdS7h3PZ0eG9t5ORAcn5BwpkEnpM98cN2CEhDcbc3UERZTipYTDtI3eT2qNkaGEvz X-Received: by 2002:a50:d794:: with SMTP id w20mr2849253edi.258.1570625549154; Wed, 09 Oct 2019 05:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570625549; cv=none; d=google.com; s=arc-20160816; b=QHeraM+lhOtv4Pb18/FqdQuBM1waqaMpYlYUYpJrZIfY0ExQffvCUKXAMH944CuMhZ uSlPidgEBWs2SwCSfSOki4uZP/9gpU18c9wW0EIqSnIcdtWWJYPCTy07aHrAFyQXPntM dGKu6l+y/MRfqcqulFV3WthwttET8rtF2NU7lMCKXOEobuYOGBXKQeBqncBWBI4xYout mwoRHF5SyZ+q92GUkspT2TQGwm3HuuH8FmBLOBTE/ZBfofjvEEvWpSGcBUz4kUtvvFBC Q2YDZ1p/yxx4o+dvzRIGp9Q7PVMkF9E2814VZODj7uTorv6JU0Lv9OxANcGaVoen/xtG 2a6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/BJ0eE6MBW5s9iScW/kEdTSjbYF64gcZuFhBIrBI/m4=; b=n45Vccefb7YlecSfKY+Pa1h2GZ7O0ETBFmWqwDdyBA5G3fD2Z4K/O8gZhyIdLK5VwE 96OPmVvpWLsoISALY5KTE7/mzUbhqOYG+69yR9M4OFJM45Y3YP9fYwLSy8HFRdfsEtBb yVzMeg9TSp2O2Y8K5m8OiY1vouxji7aeK5THxdJxGzqnTiDRgxQbUb9VHKtR3vKvDXqs bnZ/QZDkJhvKla3CO533DIYmx0trfxvJsRXRtqbKUh5o5XHqkbiohBWCQVpzm+bBnFSe TSbaVhDgjUwqCHsc+RbZVzBJOfIxPL/tnAFpGERmZV/sCAEGzPneB7hwc9vAxTQBnaYI 3Orw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b58si1309764edc.97.2019.10.09.05.51.57; Wed, 09 Oct 2019 05:52:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730110AbfJIMvf (ORCPT + 99 others); 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