Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2931598iog; Mon, 20 Jun 2022 07:44:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRRWbW02r+6JIOhRvEv1lnCwrdu1SlUr1199G8JnphK1+Lq90zT08VGg8tHSKhOQYu9Ch4 X-Received: by 2002:a05:6402:3893:b0:435:26a1:a52 with SMTP id fd19-20020a056402389300b0043526a10a52mr29328398edb.261.1655736287472; Mon, 20 Jun 2022 07:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736287; cv=none; d=google.com; s=arc-20160816; b=r3l1h8Enx00ZetZTDxw7Q/oPeyezMn73SVDVtvA5q76Svty86CwRG4GlfASHp8rhNH 590aLsLqWnzNieahsBe+rE7gULcw4jQ057/CAkQnrodLSoYnejY40C+iy9JpbUaVFV+4 3rp8HAAbDfaQKUwnm2G3uOxn4QAvNKkWGli2gNfmnxdiJwmcdtIs5Wbl23tj3W4zcIEW FP1JgAsmt6o2MvIBp7nVrltDndZtnJcMXMYnSDqsvpuszWXw9H7boMZokIQ4wkp5IYHc TIDK9FwtEPue4GzAf7iZkphBRlTJwmXBVW3otAa/v34s7YcnAl5B76YV19bvvNkEz1Cy lkkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fiuSk4MJ646ksLHxFb1h1nmy3tTTGJeUs2JkABtFlgQ=; b=EKo9BJeL18RW3aRFh4csdYJlH/L98Iysr9d7V2zeqQfhsSZIbOqvHQyRtc5RWSdvM3 6RvPtbQeQQHTQmSPxWCC/z03SZNGlSpN9H4VtV2tjUCycYUdk51vwMTjzmK5iUMnT1nV RA9JUj65Xjob4DHypNxpM7GYnu2liaPjE/ygsbrxJ06GIJU2niOLTln107IUogT2xL1o wsPXBX46IXI9stUjmAc7IYMxxj0ugDDdGd/0jyKvIbEBUVowjXAbajaHBbjeAwJnKFwy LG3B3YI7zjeCDSR4Z1S02BFkf+aDSMVV69Pp21JnoCN0+poOFIS+glK6YPvzKUKiG85E l0jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BiCuChqY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw15-20020a1709066a0f00b006ff288d1c02si12399141ejc.805.2022.06.20.07.44.20; Mon, 20 Jun 2022 07:44:47 -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=@linuxfoundation.org header.s=korg header.b=BiCuChqY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351069AbiFTOLr (ORCPT + 99 others); Mon, 20 Jun 2022 10:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349186AbiFTNwh (ORCPT ); Mon, 20 Jun 2022 09:52:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 336FE3151D; Mon, 20 Jun 2022 06:19:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CA45CB811CF; Mon, 20 Jun 2022 13:19:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2987C3411C; Mon, 20 Jun 2022 13:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655731147; bh=6I0/CeuCYV+pLjRkLPGFe3RwaMAHdm/4MmSUdrwk8Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiCuChqYxsricEp6tQfy/98o03fygFBGIV2bKBS/xawfr+j+tfVo84WV2ZTbxFArA JH/dlfvsf7bp/O0Z1b2gTJyS6N8UOOv4EUZx6z0lPqbdNr4fSfFbGWOCSk6L2qeuVS hWDQVSyAr0freMwxrmOgAPIYIxKn0a/QXO+xoGLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jens Axboe , Al Viro , "Jason A. Donenfeld" Subject: [PATCH 5.4 169/240] random: wire up fops->splice_{read,write}_iter() Date: Mon, 20 Jun 2022 14:51:10 +0200 Message-Id: <20220620124743.897085932@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Jens Axboe commit 79025e727a846be6fd215ae9cdb654368ac3f9a6 upstream. Now that random/urandom is using {read,write}_iter, we can wire it up to using the generic splice handlers. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Jens Axboe [Jason: added the splice_write path. Note that sendfile() and such still does not work for read, though it does for write, because of a file type restriction in splice_direct_to_actor(), which I'll address separately.] Cc: Al Viro Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1382,6 +1382,8 @@ const struct file_operations random_fops .compat_ioctl = compat_ptr_ioctl, .fasync = random_fasync, .llseek = noop_llseek, + .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, }; const struct file_operations urandom_fops = { @@ -1391,6 +1393,8 @@ const struct file_operations urandom_fop .compat_ioctl = compat_ptr_ioctl, .fasync = random_fasync, .llseek = noop_llseek, + .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, };