From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83B8FCA0FF8 for ; Sat, 2 Sep 2023 06:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349233AbjIBGA2 (ORCPT ); Sat, 2 Sep 2023 02:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241791AbjIBGA0 (ORCPT ); Sat, 2 Sep 2023 02:00:26 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A95710FE for ; Fri, 1 Sep 2023 23:00:18 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3AC531F45E; Sat, 2 Sep 2023 06:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1693634411; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UiJw0wZmYV8xH3B+NPa1TPI5Mn11gBz0SBgdVdGvyAI=; b=hIkKKbKv08qFtCaP5D8arDHucS3JMv12FWNwuu6CKbOhnD/W3+liToOSWcK0W3XaBbpz79 f2cxmf93ddlujT7JIlHfTlxh9qwoM4HqhpgA1dMp58ONzoLInwG2KH4PqnlC6FTOLTdOy1 Ln9s7yS33OrbAX3i+NcTvMo7jf1/PeM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1693634411; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UiJw0wZmYV8xH3B+NPa1TPI5Mn11gBz0SBgdVdGvyAI=; b=8vbCd2MKe43WIoDW2Uha+1Y/3FYvVtJrX5iHNJUg6MpOUSEqontYND2c3A5Y+djkBvjPfF 5p41zJyuEVneqXCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1A08E13440; Sat, 2 Sep 2023 06:00:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lo2EBWvP8mSsTgAAMHmgww (envelope-from ); Sat, 02 Sep 2023 06:00:11 +0000 Date: Sat, 02 Sep 2023 08:00:10 +0200 Message-ID: <87edjhm7x1.wl-tiwai@suse.de> From: Takashi Iwai To: Al Viro Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/25] ALSA: pcm: Add copy ops with iov_iter In-Reply-To: <20230902053044.GJ3390869@ZenIV> References: <20230815190136.8987-1-tiwai@suse.de> <20230815190136.8987-3-tiwai@suse.de> <20230902053044.GJ3390869@ZenIV> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 02 Sep 2023 07:30:44 +0200, Al Viro wrote: > > On Tue, Aug 15, 2023 at 09:01:13PM +0200, Takashi Iwai wrote: > > > - if (copy_from_user(get_dma_ptr(substream->runtime, channel, hwoff), > > - (void __user *)buf, bytes)) > > + if (!copy_from_iter(get_dma_ptr(substream->runtime, channel, hwoff), > > + bytes, iter)) > > The former is "if not everything got copied", the latter - "if nothing got > copied"; the same goes for other places like that. Thanks, yes, this should be if (copy_from_iter(...) != bytes) Other places have been already corrected in v2 patchset, but this place was overseen. Will fix it. Takashi