Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2177738ybl; Thu, 29 Aug 2019 04:48:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAav3CconAYm3a9BcAPUK1m1bk5sujklz0epuFulLz9BveKVCdkQZIWSQDHA8hXT6Y3viA X-Received: by 2002:aa7:800c:: with SMTP id j12mr8020571pfi.255.1567079302133; Thu, 29 Aug 2019 04:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567079302; cv=none; d=google.com; s=arc-20160816; b=CCj3UKyGwIIP+D9QkXZBzdHW9E4swwQx+jM6Jmb4YiA8AHEr06HG1q27iIGzIUaFqA cWIWVrYCk0b4LtPKUhPkur1Er6HJStmBz4W+8IaRgNitZpDavVPgCqsRWZ14ZquYb4LK +TsYynXySQn8T0+m6CxhcPSoX0cNYd5zAsS2Nbr5kW7NVBSfC+TwaubqZg4UryQGc3Bx aq7G3QoFC3xdvJtNBxjCDT50uG8YhFZGN9uS8IuLz6lRW/oG5udcoXkSxoxnLhe8nVfo khZEttiMIVG9/BOwiDw3hoHeOSNDBX3lQdYvpOnXi4Q1nGRbQqsAfZXixW+zeN6Ix+ka 2Nhw== 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:dkim-signature; bh=GJEPwHyOcI+9dLEPiZabTxPmPRqcFsYfFf6j8W16rfw=; b=KSKiIQ0yYienW23IbbQRA/l5NeEaledr4ylFCrX14IODzDZKcZr7kExM+q9C2liHsa ZvpRUDcoY4kMR6RYTFKQXhXkSoxmjmzIHjEEnTIZxghMgkEA2b2FBlysK8hCFIXCXRXv xKNyOJDtoIr747SP6HrcXV+kfboT3YEolfyrrMe2WAsL10i6ugvGJKh2mRd4gorZMN85 QSh0bUr1KKMSQ9TfV64fKa+Sv/HVpqRD008lKPQ/L3W7arxSabH/rbrLGxK8aVJ5i54r NHvHnFWq8JEdq+33l2lPTV92neUk3XDv5ibtCTtXLmNF3TT1ZZhrmU6Ol4dL9VX+l2GD bmZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=Do9PVhF7; 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 a19si1757495pgw.234.2019.08.29.04.48.07; Thu, 29 Aug 2019 04:48:22 -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; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=Do9PVhF7; 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 S1726637AbfH2Lrs (ORCPT + 99 others); Thu, 29 Aug 2019 07:47:48 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37538 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727025AbfH2Lrs (ORCPT ); Thu, 29 Aug 2019 07:47:48 -0400 Received: by mail-pl1-f196.google.com with SMTP id bj8so1465603plb.4 for ; Thu, 29 Aug 2019 04:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbobrowski-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GJEPwHyOcI+9dLEPiZabTxPmPRqcFsYfFf6j8W16rfw=; b=Do9PVhF7XnMVGEyzkcgD1V4MEr0kOY1BTS0PQogGdlpNArgszV7Li4uTixwFTX0B0e rz7bLocIOK5pi1fWJU7G2tUI6q9EYLbgiQkhwL7YhjYYZDoCAnnAdezrIbTL+ywgsojO XIioUS5nl3xf4ACNOjrkTSQJKdApent1GnNNmvCg2Zvg3U4joWVuDb1jclxwJpg4kkJv 5aSxhmukG9pD7VvTWEXb9qrF8DAE4jpdHsnfYw83piGwg8+znU/sCfPjxlrhGSnVRsd1 B4ICe535ezIk5MRRvVullgUENVe81buiPzGyRNV/wVKCXT3izPsrIMk1FMct5oTvoxeQ PKxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GJEPwHyOcI+9dLEPiZabTxPmPRqcFsYfFf6j8W16rfw=; b=euA4iofaDt3b5dg4meN8/X8gW+ScCTCI2iofVcW6HvVEEqrM7xQSc46/V37qYy3Ebs N/3vtBn6OzHC20OWWgwll1ApcdsVlESgruYc34PgBNJMnAAPMWPaLrvHjJiJrqGZj3lG n/iwhnMO5cXNv9eNlIqmjhi98y1gUKH8yS8BAhKLegGnyx81GLY6/nOawNEDLBslGNv3 c58lqnf2Rd+c4lERWHXnjk33iVfo0C+ZiuJ8XwJap7oVCK7f51zQqhL/qPenlQmcudGo POMoLElCrMj68bSJaMK479VU6rc4byoqAZDiNC8n+qwq9uq3S6Jhlhlg+6a0XCeUcH7I Th6A== X-Gm-Message-State: APjAAAVgiY72LziFKTn0GI75rafbiEkeguk7gmNnL6aprpbHEaPz6XPb KtfJuJXRO7ZhZXB0nFoLzMv0 X-Received: by 2002:a17:902:7892:: with SMTP id q18mr9016585pll.206.1567079267436; Thu, 29 Aug 2019 04:47:47 -0700 (PDT) Received: from poseidon.bobrowski.net ([114.78.226.167]) by smtp.gmail.com with ESMTPSA id b18sm3137286pfi.160.2019.08.29.04.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 04:47:46 -0700 (PDT) Date: Thu, 29 Aug 2019 21:47:41 +1000 From: Matthew Bobrowski To: Dave Chinner Cc: Jan Kara , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, riteshh@linux.ibm.com Subject: Re: [PATCH 4/5] ext4: introduce direct IO write code path using iomap infrastructure Message-ID: <20190829114740.GC2486@poseidon.bobrowski.net> References: <581c3a2da89991e7ce5862d93dcfb23e1dc8ddc8.1565609891.git.mbobrowski@mbobrowski.org> <20190828202619.GG22343@quack2.suse.cz> <20190828223218.GZ7777@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190828223218.GZ7777@dread.disaster.area> 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 Thu, Aug 29, 2019 at 08:32:18AM +1000, Dave Chinner wrote: > On Wed, Aug 28, 2019 at 10:26:19PM +0200, Jan Kara wrote: > > On Mon 12-08-19 22:53:26, Matthew Bobrowski wrote: > > > @@ -235,6 +244,34 @@ static ssize_t ext4_write_checks(struct kiocb *iocb, struct iov_iter *from) > > > return iov_iter_count(from); > > > } > > > > > > +static ssize_t ext4_buffered_write_iter(struct kiocb *iocb, > > > + struct iov_iter *from) > > > +{ > > > + ssize_t ret; > > > + struct inode *inode = file_inode(iocb->ki_filp); > > > + > > > + if (!inode_trylock(inode)) { > > > + if (iocb->ki_flags & IOCB_NOWAIT) > > > + return -EOPNOTSUPP; > > > + inode_lock(inode); > > > + } > > > > Currently there's no support for IOCB_NOWAIT for buffered IO so you can > > replace this with "inode_lock(inode)". > > IOCB_NOWAIT is supported for buffered reads. It is not supported on > buffered writes (as yet), so this should return EOPNOTSUPP if > IOCB_NOWAIT is set, regardless of whether the lock can be grabbed or > not. Noted! Thank you Dave. ;-) --M