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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCDB6CA0FFC for ; Sat, 2 Sep 2023 06:01:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2F00A1FC; Sat, 2 Sep 2023 08:00:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2F00A1FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693634478; bh=NlzT/15Y7yg40boDvvvkBG3Z3aDkm9zBzvJaMeFvbFo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=BtDCwtdHbVq8+f5tb+iIwKn40nT5+llzpGTEZx9XnSj4KFDWY+yzqzwd2IRJB/kY4 JXMkFoIulKkaB6jpeRJ7GCgSW7EsM3SOws6Zf8MYgGfxSQbvoTOF/U5uU4E+hHb3ez CsoVHf7uSUekLJNpJw3eJbOFjfpCnlfRYB0S8v44= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8186F804F3; Sat, 2 Sep 2023 08:00:27 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3DABEF80249; Sat, 2 Sep 2023 08:00:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61D95F8032D; Sat, 2 Sep 2023 08:00:18 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F2F89F80249 for ; Sat, 2 Sep 2023 08:00:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F2F89F80249 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=hIkKKbKv; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=8vbCd2MK 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 Message-ID-Hash: KGUYZBLLDUC4OHS66BA4GNI67QDJX4VZ X-Message-ID-Hash: KGUYZBLLDUC4OHS66BA4GNI67QDJX4VZ X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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