Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp2001680lfo; Sat, 28 May 2022 13:24:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLnzHsQOLbxPmpSunRTbDb3mNbh9zOpDaU6c7e5Cy2bQiUqQsVqNKkEvjPy6DwvLEkOsKk X-Received: by 2002:a17:903:41cd:b0:163:5f72:1610 with SMTP id u13-20020a17090341cd00b001635f721610mr18554397ple.112.1653769479956; Sat, 28 May 2022 13:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653769479; cv=none; d=google.com; s=arc-20160816; b=pqRwrb6G/UqRlkaDyPd1tUTqMCJOBaM03ZqPVdvhCQZPOtmcbbp7tPKtGzgG4vMTsR HUiNLGT1tFWWXWwpeiTu1CXOiPFfHa0B0DvfHeIBOd86FyUAx51R2VlLGna+80uZAFKv iMgAsUB1hmFS/joC5iU8U4EKnROqPl9QQZGDo9N55zw3tskdC4LpcZdQ70/DWDDG0y9q tp8EeWq+ePJ1a+fDz+LIR7xzfOOwiJjlADj8NrqplN3IKsNBVmPriMzF83vYtvckk+O3 EhSjXCS52H/pTWCGuXBTCd382+SOPX4lZk0GqVKh9rya3NvSavxARoYtK2fj2LgvzVQ/ ks3Q== 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=Z/vT5Ala3RGqRTxXdm1ytYhA2HAdcu1ojBW2hg9LD8o=; b=kKeD01Wfloj+VIZsmYz55F/zaGJl7+7SCvB2htZzpyuX3jQmmfbQIYnourPG8J1L4Q IbErr5DvhS/cGRKCsJnaxEeyiy/ENu+djPx5M4K4nqlwskrm9v9WRlz0cHYsMnK3WWGH yk2wA29cVCRRG6TtMWhKse42XW6F5p/k9MQLT8DzYYUC4E5UqcYBioSyTp4X1KheYI+n TZYtwxDkFmHPpqI+W+VElDjzM6F6DIxf1s6fY5iojoFEE2vFjrN633gShwSl/6JIimda qz1OgW1dThBUCsvr4St6ytM8Wg/JEYz6d69evHc3eQFW7lQLXUV+wZbrc16euhM838iB GJGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ec6vi0UB; 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 g15-20020a056a0023cf00b005193e447126si6729018pfc.41.2022.05.28.13.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:24:39 -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=Ec6vi0UB; 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 11DF3377CE; Sat, 28 May 2022 12:31:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351311AbiE0JGG (ORCPT + 99 others); Fri, 27 May 2022 05:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350367AbiE0I7v (ORCPT ); Fri, 27 May 2022 04:59:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C81A5C74C; Fri, 27 May 2022 01:55:40 -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 7493AB823D9; Fri, 27 May 2022 08:55:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6869C385A9; Fri, 27 May 2022 08:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653641738; bh=n9Mi0FvNLEAgAgJnTK3eCwMvmEqwnQD6rLaqbwmcRjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ec6vi0UBvMRVbsqJgspIDwNYG5r+crmZCocEIYDu/1pQDSP+U1j1Dpjp7ECUq04rg w8d3A70D0gsccW8ofDCFLikAUJHXbBS9oTYu7OIZhGi8CQ6b9reEPXQ9eWkHKkKu/f J88LH9EP5pLEd79jxLy2jK/rHMysIVuDUXC4r7jA= 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.18 44/47] random: wire up fops->splice_{read,write}_iter() Date: Fri, 27 May 2022 10:50:24 +0200 Message-Id: <20220527084808.550417490@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220527084801.223648383@linuxfoundation.org> References: <20220527084801.223648383@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 @@ -1429,6 +1429,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 = { @@ -1438,6 +1440,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, };