Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp329938ybh; Mon, 20 Jul 2020 18:15:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOnCcQtelbXEZI8CZe6ad6x+UiSCAIadshWPGEyX1RMlVPcPXxq5VRqYyrOxH0t6vOZyCV X-Received: by 2002:a17:906:fa9b:: with SMTP id lt27mr22603485ejb.513.1595294153283; Mon, 20 Jul 2020 18:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595294153; cv=none; d=google.com; s=arc-20160816; b=YFxLnYKYVC1Tl8JQPK7xqd8qx51yS6b3KyiQt9LxRw/GvBhyNofffpGnqA1OEFMyzZ 03PDyOjCLT53DIwZ4ysUgj4SLkdVrcj+TOonEQXNGF9ya6yOeq918bHwatQxL29bMvCb h9OIhB+GuFuJzK70aMA07qEB9ny/ElwRF6apmYTz+9am8ULJo2FSsKMlcxQ2AGAUQFLK F2KKj5kXFbRrhn3tI7fCF1iltHG86E0lqFeons/x4LCd9IjiHpfObRJ+6xVcHohw8svA 03W5O9HoJz7EJSA+P4J2NDeLA87t/T1T/EwcATZteipipG/aoiXKaYsE80pA/YrTU2JJ nQ8w== 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=rfyhcPl9yATKYlIzjLr+e3/ETCiHE9A88WTd3Cfuwq8=; b=dYjDUVfbYyLpsNQXstJfOkLYY3M8FZXtBnRdAvEz3eBzv5c3V4dmnEgzD72vkVyPB5 uQaFMHzfPyBztOKB02sX1/v0nvOwUuYCZw3SePj1EV8q8lXWW8dWYCxX0ASyKXO6VqmZ EMSg0mCUOuz9R0eQA+HaLK7b4WFf6BidAK8peyhro2Lyekw7Y1mKwJPEr2TEzYuZuFn1 0KuePQL9R+apgdLzaJYtiMWTDjpJECjb6cn/JGm045IG64bd32d1ArS+7otjLSkRz4Eq tnkZyRSbuPTsQk4+Eu8Ip3Di0nTBR2x9Co69U4pxv2NxGQerAiMxAxV+E9ey7ihIRU8H PAuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=pQbISmCe; 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 z15si5936501ede.534.2020.07.20.18.15.29; Mon, 20 Jul 2020 18:15:53 -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=pQbISmCe; 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 S1726811AbgGUBPW (ORCPT + 99 others); Mon, 20 Jul 2020 21:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbgGUBPW (ORCPT ); Mon, 20 Jul 2020 21:15:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93ECC061794; Mon, 20 Jul 2020 18:15:21 -0700 (PDT) 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=rfyhcPl9yATKYlIzjLr+e3/ETCiHE9A88WTd3Cfuwq8=; b=pQbISmCeuLOm33gOVjUe/3XMwu 8+fp6sISGUaQcuvvJXy4HS2N48WBarQc00tX4EiqDW8QgmyQNmiQh9kcUR3ufwoakx5eucXfY4pOd hK1gjZSdwBcskY8uYqIagekeMC0NBgreIhonxrpxcY8k3RO1iJVbcjW6O3fSA/F6UPnypXVqZYrvw mqAjLRgnT9OJ+kqj13qR7ec3qEpahCVR66trvmMPc9u+pbd0dp5WV9/tFMU8hQhGRXgA7WhfwUuwG TkQcp5afvKaM3YszjZSaf1nnOWdtjVjag02kFjbdDYA/elF42KHNPDZsLhkBWxMclmq8iMSrcHfFe FpdPfKow==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxgs9-0007nN-Ny; Tue, 21 Jul 2020 01:15:10 +0000 Date: Tue, 21 Jul 2020 02:15:09 +0100 From: Matthew Wilcox To: Damien Le Moal Cc: Kanchan Joshi , "hch@infradead.org" , Jens Axboe , Kanchan Joshi , "viro@zeniv.linux.org.uk" , "bcrl@kvack.org" , "asml.silence@gmail.com" , "linux-fsdevel@vger.kernel.org" , Matias Bj??rling , "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: <20200721011509.GB15516@casper.infradead.org> References: <20200710131054.GB7491@infradead.org> <20200710134824.GK12769@casper.infradead.org> <20200710134932.GA16257@infradead.org> <20200710135119.GL12769@casper.infradead.org> <20200720171416.GY12769@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 21, 2020 at 12:59:59AM +0000, Damien Le Moal wrote: > On 2020/07/21 5:17, Kanchan Joshi wrote: > > On Mon, Jul 20, 2020 at 10:44 PM Matthew Wilcox wrote: > >> struct io_uring_cqe { > >> __u64 user_data; /* sqe->data submission passed back */ > >> - __s32 res; /* result code for this event */ > >> - __u32 flags; > >> + union { > >> + struct { > >> + __s32 res; /* result code for this event */ > >> + __u32 flags; > >> + }; > >> + __s64 res64; > >> + }; > >> }; > >> > >> Return the value in bytes in res64, or a negative errno. Done. > > > > I concur. Can do away with bytes-copied. It's either in its entirety > > or not at all. > > > > SAS SMR drives may return a partial completion. So the size written may be less > than requested, but not necessarily 0, which would be an error anyway since any > condition that would lead to 0B being written will cause the drive to fail the > command with an error. Why might it return a short write? And, given how assiduous programmers are about checking for exceptional conditions, is it useful to tell userspace "only the first 512 bytes of your 2kB write made it to storage"? Or would we rather just tell userspace "you got an error" and _not_ tell them that the first N bytes made it to storage? > Also, the completed size should be in res in the first cqe to follow io_uring > current interface, no ?. The second cqe would use the res64 field to return the > written offset. Wasn't that the plan ? two cqes for one sqe seems like a bad idea to me.