Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp573616ybt; Fri, 10 Jul 2020 07:12:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGWsImTTkdI7sw1xpzRLkCzIOhapkxIb4LFVzwv1gPVxNxJk6cYzp418iz7HUZRtZpef/C X-Received: by 2002:a17:906:4a45:: with SMTP id a5mr59902948ejv.384.1594390360579; Fri, 10 Jul 2020 07:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594390360; cv=none; d=google.com; s=arc-20160816; b=EqTZa5nKVEBVzr8WuBtvlEJBQ1X00O4j/7Z1/dnkLWdaqRNT+hw5sYLTuZ/7KTNiCz hQfku3Yj5M0rH7U7gABfxO1FeVh5Wi1bk2tBr6jKlyl2SZ/p8WEUH2iGy7lv4Cz1G9d8 KGsuG8Wm35Ak29uzc+WapMBxXYRz+eNlide/jGjt4np3zYztIvR1TyNbLAgfYTIEdp4e ud2diGN/cBspOv+nuCcblWiXzRXsZV3QXDjeqDRm2bu3wXqPNir2/zTvRmAu8qhAuWa6 h0cqbQ2+SeRHxEE/4tj6/wSkpcuPN16WtORYHX+wo6NG4JOAaS5POD80Pdpnc/WoMYh2 bl/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VGeeR8+VbNtB7URPLqfeyF8R/0u0wMAauszGUX1N1UI=; b=BHIz6iu0smOK7XjUtQ6BtXdaPUd6ITJCV/osMHcGekpIl6vEPF/YDmXUJQmGTQaJBo uOhWgs/btFhO8GTgEQ0fuB8+xAJnaoBe6KP0RoR8uhHo5N+t0eh5RZQIEezBD9C5Y4DK HFm+8l9RH1CBbHKYHbJ7DZP+PC7y0WQGlWA5s6e6ucfFtS6hE6YO0YOEsWdRMOXh1vjc llGFsEHw04FKvj9XfJN0djgC83cIynfrDpbhYAOIWxC55t0aoVi9yXV+w6J4pvPH0Kwg deRsgaGD0OJpheBF6HizIsexUhBECsswKSvKc03FWrBhvCbnUuMJysc9tM/YUskdhfA1 BEog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fk0BU7ia; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si4170642edt.383.2020.07.10.07.12.15; Fri, 10 Jul 2020 07:12:40 -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=pass header.i=@gmail.com header.s=20161025 header.b=fk0BU7ia; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727907AbgGJOLr (ORCPT + 99 others); Fri, 10 Jul 2020 10:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgGJOLr (ORCPT ); Fri, 10 Jul 2020 10:11:47 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 048F7C08C5CE; Fri, 10 Jul 2020 07:11:47 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id o8so6312650wmh.4; Fri, 10 Jul 2020 07:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VGeeR8+VbNtB7URPLqfeyF8R/0u0wMAauszGUX1N1UI=; b=fk0BU7iaq6X8TwybCHTvJwUCTakRRnB6bs6MI80jO2k/15kDhIIIoHZt5ZVGA7a6nv hV6Yh9e81iPov/qajATCsYe/c6NeRIcS20LNg52siwqUX6u3VxeNYDkHCaYpXDz3sesR 3Ulry/Xu+YcNYFGogM36GHBVr/nLyKWwB8yN+B4JOfNdNDvsgl6Xyx9sHtC8js15nxNc nklaZ6IT1IayDupdAOiUuueQIAip22AQGlYBr81JJttcMam+vf9cCdSbd7Dr0GbPPo8S WuCA8IGNqtAVATytmAJ1Fk+OlPI//tMI5/RRQlUAb47OVCI6/1nGJ7E0n7Scdyv45XhO GJUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VGeeR8+VbNtB7URPLqfeyF8R/0u0wMAauszGUX1N1UI=; b=abY8ydoh2znbR3wVQPv5/cy10JYdkWgKdo+75Z2CEXQ12HV6M6tB22Zc5gNoGoG6cc i2KArNk9Y2xlAb8HNcpFZe6ZyKCWeDfw8WacJpVx5C+P5chbY1TXRx6DAGXdvJDl7mpp 8ZYnUdhv8ZNpM6f7e5sizuMZeuCaMYLS/aZa4obbEl5oqWoErlRRupzFs24+3uUJbooO 3G8YwshUZ6GfdFvzCJr9egWuzBxX57S8dQUUN+ZgAhegksfUHoPo7DpWvGldqFoiAVUn dOxqsscScMDmG9apCoPtAVP13Dda8giMUiONEYgl7ovpma4lcqbqhlmPpeH160EFXMIr qkiQ== X-Gm-Message-State: AOAM533kd7eKPkaZRLA2DrS+Eqq/y+pkNlMAgPqDZ0YcWsKQK3CRgS/T F0SSyQVIxsMI9zoANrcL+MGLBC7lox5CBwCZoeM= X-Received: by 2002:a1c:9e45:: with SMTP id h66mr5276012wme.15.1594390305664; Fri, 10 Jul 2020 07:11:45 -0700 (PDT) MIME-Version: 1.0 References: <20200709085501.GA64935@infradead.org> <20200709140053.GA7528@infradead.org> <2270907f-670c-5182-f4ec-9756dc645376@kernel.dk> <20200710131054.GB7491@infradead.org> <20200710134824.GK12769@casper.infradead.org> <20200710134932.GA16257@infradead.org> <20200710135119.GL12769@casper.infradead.org> In-Reply-To: <20200710135119.GL12769@casper.infradead.org> From: Kanchan Joshi Date: Fri, 10 Jul 2020 19:41:19 +0530 Message-ID: Subject: Re: [PATCH v3 4/4] io_uring: add support for zone-append To: Matthew Wilcox Cc: Christoph Hellwig , Jens Axboe , Kanchan Joshi , viro@zeniv.linux.org.uk, bcrl@kvack.org, Damien.LeMoal@wdc.com, 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 10, 2020 at 7:21 PM Matthew Wilcox wrote: > > On Fri, Jul 10, 2020 at 02:49:32PM +0100, Christoph Hellwig wrote: > > On Fri, Jul 10, 2020 at 02:48:24PM +0100, Matthew Wilcox wrote: > > > If we're going to go the route of changing the CQE, how about: > > > > > > 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; > > > + }; > > > }; > > > > > > then we don't need to change the CQE size and it just depends on the SQE > > > whether the CQE for it uses res+flags or res64. > > > > How do you return a status code or short write when you just have > > a u64 that is needed for the offset? > > it's an s64 not a u64 so you can return a negative errno. i didn't > think we allowed short writes for objects-which-have-a-pos. If we are doing this for zone-append (and not general cases), "__s64 res64" should work -. 64 bits = 1 (sign) + 23 (bytes-copied: cqe->res) + 40 (written-location: chunk_sector bytes limit) -- Joshi