Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4068230imw; Thu, 7 Jul 2022 12:10:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBIyrpKd6IgE+krP4hbjP5XYalfVl2X7mqLCio/1/tlQEoVHCYdcjeL/zDeJzVAjj5RcNg X-Received: by 2002:a17:907:7294:b0:72b:1ae:9c47 with SMTP id dt20-20020a170907729400b0072b01ae9c47mr7316561ejc.253.1657221017016; Thu, 07 Jul 2022 12:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657221017; cv=none; d=google.com; s=arc-20160816; b=h4z4Qyas35SPq+7E+fMnSqMbXycVCFuTVJHStJVApn2wVZp5Z1dYSxTux5mmzmeX1M qk+i0lRbO0ittPjdkdG43oGBqvNda7WiklkX0C9RnO/nwmpMfEZVVEWOoOfmEPlAo5Pu wTeNfXUNWyKMBXdkzFk25lfuomjiV+vY6VIPCGsPO0jUFTLu849PrZwSc2oYlBR3F96W 2leL3TQoKWdC17/xIBpUDOKN1rFGqIylhaYxEL/tq/er8iohSt6yUAHmYH6IhsMRwhs5 JvOGBHa2J5Yn0P9liPZuttEHQv/EUsN4ptj1GVBRLGTvpMtmARayfEwDDFE2x7ShVAJh EfdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=05SlPgOjw8Ge7G3S7ysnQzpGsSQeCNpy+r8rpobhENo=; b=tDa5X2yEBQxI+84ExP/A63aYqbX8GFnP8ZVTcstwBWGxzkcJxNEyrMVNtNC309Ygmn 7PWTB9J5P8vJ+m1LKVzklP/NcVkLbvag0omVvq2sG9iFrukONZiXfwlrsYJW9yGNtgEn h08wknVw3rw6ayysDTvzXjXZInl/PgT8q+BAz7+eIHH+eMZzw1ajpWUPydjGpe5z9Yha UdN2KBQWrnF+gWWKITS6Xt6voI/b5/WDTtHfLIrFbfSRYTKvxvCkrHKZB0XzWTFFkoFv JrGI2hJFBqCdwf3vzxW6TCDVVwmPjF2WQiNhcibYkD9nRO7iiiRannug69Q9+Js9B6in gaLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Vbk/7Nvh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i14-20020a1709064fce00b00726abd9108bsi4027783ejw.168.2022.07.07.12.09.51; Thu, 07 Jul 2022 12:10:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Vbk/7Nvh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236418AbiGGTGd (ORCPT + 99 others); Thu, 7 Jul 2022 15:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbiGGTGa (ORCPT ); Thu, 7 Jul 2022 15:06:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2198157230; Thu, 7 Jul 2022 12:06:28 -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=05SlPgOjw8Ge7G3S7ysnQzpGsSQeCNpy+r8rpobhENo=; b=Vbk/7NvhWFnJ0xBPYy409PU2F8 kH3S9RPlLO4ChI+L3vk7Awx/gNAS8+F2row0fMBq+SKGAuDiu2wy62hQlZWqyNgGPUW+72uzuFdPU GXlGo2d+FU8Ot9NIKmZLzmW6vc3MpiNUYehYjIzf0mkLtJoxyjcLI+Roj6gzQrQP71ELtAJpa7DJG j6VOZpP+WyZxGY403J/cpIJ0nCXlcYxJJXqgp4RqxM0oBBl/mMJR3Walhj34C1/qOyxtoZQ2CVctp 5xgRVQmJiNiFCjEBn0kP/OUKZIYlNJIf+EXxWjYqpubrKnKAcqykBp9oF4TJbgJN+XQzlkVz5fUK9 X+nOKZLQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9WpQ-002qNW-3O; Thu, 07 Jul 2022 19:06:20 +0000 Date: Thu, 7 Jul 2022 20:06:20 +0100 From: Matthew Wilcox To: Al Viro Cc: Alexander Gordeev , Alexander Egorenkov , Heiko Carstens , Vasily Gorbik , Baoquan He , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH v2 1/1] s390/crash: allow multi-segment iterators Message-ID: References: <613f63d652bb4fa6fb3d2bb38762de6bb066b35a.1657172539.git.agordeev@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 07, 2022 at 02:31:44PM +0100, Al Viro wrote: > > @@ -73,10 +73,9 @@ int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count) > > } > > offset = src % PAGE_SIZE; > > bytes = min(PAGE_SIZE - offset, count); > > - if (copy_to_user(dest, hsa_buf + offset, bytes)) > > + if (copy_to_iter(hsa_buf + offset, bytes, iter) != bytes) > > return -EFAULT; > > Umm... Then you want iov_iter_revert() on short copy... ... maybe better to change the calling convention to return the short write and have the caller do it if they care?