Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp602472ybt; Wed, 8 Jul 2020 07:25:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoIDe/INYesXwGr9BlnPNm+DqBD3/+Dg73Y6Fs9lVy9WlfAsuUEBHmVUi5ORwn/EWHAvwp X-Received: by 2002:a05:6402:1246:: with SMTP id l6mr35987507edw.224.1594218339764; Wed, 08 Jul 2020 07:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594218339; cv=none; d=google.com; s=arc-20160816; b=XCAehMqI424mBB6FKtzBvWYb5TmYCSlilUtfJGdZ+4IyldgHuAwnP0iBNTPqt8P1gu W7zziOLx5WI6MiuSNjMd0gIja6yA5sknDYjbVj8mmf6iB7/aLYqm3P917MLyDCGgsPX2 cR+a24RSsT/PF44KOhcsWOnmHj3Dj930OTmfWN+YV+RZQQ9dTjL8vVjY8ly/NGCfzA88 d/aPS4mjUYL9bqCe/SQQ/3QAp63JiLDz/YHgkzbpj8O7W5c8uTjnFNXNvCAX+o4pvl66 bnLIXFafzEikY2o1EVrh+6Ct6EXfjPBeeF546hlmuA0QDESP7VuHNpZ0G6G+BGAm85ni rPGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=MrAnEvtYxJ3CG9gxR3loAOZTO73HHraqyOfrOks4hhg=; b=bEJaJgjmTf7KsTIfb8GNj0PA0JGM4KPxa/kPhEL9rDWEhP4sqMF8IPrWr083JHTzUJ nZR9lSkkDceY60s1L/0PiP9rntdCznFAaQ30j92RmbxOkanDWlW+UA8pHqRNXgWmN/cR EA02iyWsXs+gO4AqUPCl/u2Cujl3+ccS6G1t8IQZz/0ifPAzT7XJYx3WAXR0LPapmChI Bw4GHHwItOoBYZ1uFt74IS9T+96dc0eVqZCUuJk/rC6u0rGQHouIu2RT2BTJppiN6xuw g+eaOqB8r+79FROAF5pnfGn4kA1EESpl+4abPf8cLLILMh7Il2gPuAD6BHarZCLjewzn oZZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=JMJwqmeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si86203edv.217.2020.07.08.07.25.17; Wed, 08 Jul 2020 07:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=JMJwqmeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729746AbgGHOYK (ORCPT + 99 others); Wed, 8 Jul 2020 10:24:10 -0400 Received: from casper.infradead.org ([90.155.50.34]:36036 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729467AbgGHOYK (ORCPT ); Wed, 8 Jul 2020 10:24:10 -0400 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=MrAnEvtYxJ3CG9gxR3loAOZTO73HHraqyOfrOks4hhg=; b=JMJwqmeTQ9cGJpeD9W93Dw1IjO XWotEiYbye0J2WZMFOcGjZcu3WbLV55gbbJHp4tN6THMa9cj8svxx7BtFefMqc5eD0hLPhSeiRHfc dht8oKIrdba3H++FPHoTHrH8o9AQOKTc5hTH/OdDHsBq21QVOWsKJkMnSgzwbdKEGeCAdNafeHIRP HEnmGYkfg5gUtC+4LV/Yixsovv71OLHrATMzHBfgyjOvNVwWFVhR/b96qceLBtbGfR6b7iZywHu96 xYgs+G2w1wHc8O/belST07+MM+apfnisUfdTHRfp0HtCEz7f1uB/VtCHjo6wP6mC5f+lUYi8bEbKU 1Q3ih66A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtAyJ-0007LT-Jr; Wed, 08 Jul 2020 14:22:51 +0000 Date: Wed, 8 Jul 2020 15:22:51 +0100 From: Matthew Wilcox To: Kanchan Joshi Cc: Jens Axboe , viro@zeniv.linux.org.uk, bcrl@kvack.org, hch@infradead.org, Damien.LeMoal@wdc.com, asml.silence@gmail.com, linux-fsdevel@vger.kernel.org, mb@lightnvm.io, linux-kernel@vger.kernel.org, linux-aio@kvack.org, io-uring@vger.kernel.org, linux-block@vger.kernel.org, Selvakumar S , Nitesh Shetty , Javier Gonzalez Subject: Re: [PATCH v3 4/4] io_uring: add support for zone-append Message-ID: <20200708142251.GQ25523@casper.infradead.org> References: <4a9bf73e-f3ee-4f06-7fad-b8f8861b0bc1@kernel.dk> <20200706143208.GA25523@casper.infradead.org> <20200707151105.GA23395@test-zns> <20200707155237.GM25523@casper.infradead.org> <20200707202342.GA28364@test-zns> <7a44d9c6-bf7d-0666-fc29-32c3cba9d1d8@kernel.dk> <20200707221812.GN25523@casper.infradead.org> <145cc0ad-af86-2d6a-78b3-9ade007aae52@kernel.dk> <20200708125805.GA16495@test-zns> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200708125805.GA16495@test-zns> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2020 at 06:28:05PM +0530, Kanchan Joshi wrote: > The last thing is about the flag used to trigger this processing. Will it be > fine to intoduce new flag (RWF_APPEND2 or RWF_APPEND_OFFSET) > instead of using RWF_APPEND? > > New flag will do what RWF_APPEND does and will also return the > written-location (and therefore expects pointer setup in application). I think it's simpler to understand if it's called RWF_INDIRECT_OFFSET Then it'd look like: + rwf_t rwf = READ_ONCE(sqe->rw_flags); ... - iocb->ki_pos = READ_ONCE(sqe->off); + if (rwf & RWF_INDIRECT_OFFSET) { + loff_t __user *loffp = u64_to_user_ptr(sqe->addr2); + + if (get_user(iocb->ki_pos, loffp) + return -EFAULT; + iocb->ki_loffp = loffp; + } else { + iocb->ki_pos = READ_ONCE(sqe->off); + } ... - ret = kiocb_set_rw_flags(kiocb, READ_ONCE(sqe->rw_flags)); + ret = kiocb_set_rw_flags(kiocb, rwf);