Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp2002835lfo; Sat, 28 May 2022 13:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhd2MR7WMjA2uS9GpnB6+Q5ekFmQcCE/j81ist5dpaKaIUvafLptvjY2ROjHe/+bN1PhSQ X-Received: by 2002:a63:8a4c:0:b0:3fb:e512:5755 with SMTP id y73-20020a638a4c000000b003fbe5125755mr2269888pgd.399.1653769730959; Sat, 28 May 2022 13:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653769730; cv=none; d=google.com; s=arc-20160816; b=EBXKhRJ+3HpFVuk4CzQonLKTvU7MAqKfjgJmlonixU791NBGj00bac49pelQ8zclmb bxuKn24hKn/HKyA2xFpGXd0Qkz/AYVKG+WDCZ9Sjk08imF5Ce2wWILlHc28/MGK4J6an kZi0Vk8UXZrN4DlyqhE+yCbRAzXW5/Gz9AkH1FG+qAzeEYC1AU+OlAqLgc9XORhgzoQP 1qM2v8HxpeART6jGuCGMLd0ggn02SGxYFn1fV2e5APEcSnaYRzq9oINRUB7EOIM9Y75A QZcG5ovVFmYc3kBsrNVm1LWiex70PX6dKFhnpRBk7Kx1mz1RbKgr35JflHeqBhCGlvgy 1jDw== 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=/YQbGfyl05f/xNHKjsVGflmXufiGnBQnEMHyhHia4RY=; b=WEjkiBM15VV+yrOomSFVbfSlFgDhGzEozJpjXgfBAZFmvKpkcEYkZWxDlT2hz39tOX ceEsFqZa26gaRpZHXxYDb3jBUCQ9cZHHMNCIFi1Vbw/8kFlZlakl9DyUnKwuAxaNJARm dozTExPv2I1BKZaTlLKOILtRAsCIU8A0zi7Aa9pvbavRTtNPA1spOVc+sZ08HGlfyZHt vHlDT8DysSAqulNR7ShuYkrDwPuQrAqrVAh+JD63ArmD+A07b7RvGeN+7EmazTd1Rpfr D73bOjon6jqLbA27C+yfLP8qihp4IyZCygYURLzAhLiYBuVNpLtAW/YxuHPFu8V7+Nq0 TIcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mCvuL2kX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x7-20020a62fb07000000b005191e154399si8951636pfm.258.2022.05.28.13.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:28:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mCvuL2kX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45C861B4377; Sat, 28 May 2022 12:38:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348114AbiE0L5O (ORCPT + 99 others); Fri, 27 May 2022 07:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353033AbiE0LvJ (ORCPT ); Fri, 27 May 2022 07:51:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70651053F1; Fri, 27 May 2022 04:46:37 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 162E361D94; Fri, 27 May 2022 11:46:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EB9FC385A9; Fri, 27 May 2022 11:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653651996; bh=BlPUSq4NXxaVerrK3wlsEA2VYB0g37GE3yAVYt5V2tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mCvuL2kXbvte0z9u/b9V9slpPgAi6u7Ruz/dKpDFMhNJluc71NWQkvsdeplKKs0I5 eBuBW4tTOeLk3Hv6A9V9BexBPrMPeBwuUb0qE6kmU68cpttL+SpJ6xLx9XQOX6RTbU nKMw/a4sJPK4gNG81a4TdNt29nDvcF+hLrwKsFOg= 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.17 108/111] random: wire up fops->splice_{read,write}_iter() Date: Fri, 27 May 2022 10:50:20 +0200 Message-Id: <20220527084834.539636961@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220527084819.133490171@linuxfoundation.org> References: <20220527084819.133490171@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=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 @@ -1384,6 +1384,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 = { @@ -1393,6 +1395,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, };