Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp99952pxu; Tue, 1 Dec 2020 07:03:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvmHH7fB5ultC72ZxsAVJaITtfQqAurnJoeyXy7NCqrtB5YdpUMrq02lygIyzXQ51emlfK X-Received: by 2002:a17:906:c790:: with SMTP id cw16mr3552133ejb.344.1606835015710; Tue, 01 Dec 2020 07:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606835015; cv=none; d=google.com; s=arc-20160816; b=LKi9XHtJXSi18ds1tiWAxrn977I0WFsVr1+TrqhdddMc6QRsz5iS5sOxrD+yUe+bn+ 3NjxAqAvhY6JBASyPycqF/vSZSsHpyGMqf7vBphpUzqqcaSXmLYukGNVmIcMvLyt/JbF uzg11WPARNy/68gHwLzZaQ0xukdfKXDLww3jIfWQSQvKOkEek3QMZmARbrzRcFDI7WWF wvpPUG5QUXVGZSSIf3NsAhkxt8uEWN237IrjqeLl5L1Rl1EXBbeGB9PbHZxzS2lQ3hbI Bv8CJGhMTsL1Y2mTDAA4XOiofBhihd1Ibv+w/v+HuPymWcXjzObzIV1+oc+JLc6KJSK3 pM1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KWM9/yD4Vf2GzZmCpfsa4i12NAQl3U3t4hvjjC22bOg=; b=QIaFQZSlzamkgnh1nBPZ++DymY4/stuYzOz3gPgN07UHF84szGm+JdPxT+ojZt3Cwv ceGB1XgMtjXCYIuZ0zo+ABSBXJvUzu0ZojeJw+6z51cXWPyEGZ8vw0TR1yM7tq/Wm82z 0JkTmnF4823ZBMJybVcbMUdPlash5rskmF1G7tcn9sVG+3xD2s/GtwNhIYIWd6ojE2TV vm9m+Tp4kDHy5STZqmaKHu1ygW+IIGXFSDHF897rN7phBXpyMpyVQaP13jbwP4C+T6wZ FqkuXhN7mP94sNw2NU6EjUZit3Jp9c/jFXLj77j48fKeZcUaFT7/8ra6lcCK5yiXCPIH 8Xgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=MFKTVGZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh17si39848ejb.328.2020.12.01.07.02.55; Tue, 01 Dec 2020 07:03:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=MFKTVGZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391621AbgLAO62 (ORCPT + 99 others); Tue, 1 Dec 2020 09:58:28 -0500 Received: from nautica.notk.org ([91.121.71.147]:33666 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389268AbgLAO62 (ORCPT ); Tue, 1 Dec 2020 09:58:28 -0500 Received: by nautica.notk.org (Postfix, from userid 1001) id 9C8B2C009; Tue, 1 Dec 2020 15:57:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1606834663; bh=KWM9/yD4Vf2GzZmCpfsa4i12NAQl3U3t4hvjjC22bOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MFKTVGZOh4oWAw0CakGRic0UDGpkp8pWIkr8bX5tDScoKsPIdHhLZAWk7YX8av9En mlfIhkeYy0qBFbIT23fFHxnHdHnNW2RP3QYYhvN40UAT1k/oKigfn5rXuYTYdCFo/u Uk/Y/NQ9nUNrFo5toEIyczPDT+ggFf72SRjtAFMByDL+EHqSaRz7leYda06Aa3V7fY xKJjo8o7sfWmrFr2M7TcGruAXAKoubEHJFdiiPXc+0n9rAb2qtKfU2zPnTDR5F2MMe 14G80x3mJEutD6kVcO3yL0lpLwdNl0Z5/J2KXRLk38BtUTk1ugGO/84EPtmqLydnMX UWifdvQnHNoZw== Date: Tue, 1 Dec 2020 15:57:28 +0100 From: Dominique Martinet To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Cc: Eric Van Hensbergen , Latchesar Ionkov , v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: 9p: add generic splice_read file operations Message-ID: <20201201145728.GA11144@nautica> References: <20201201135409.55510-1-toke@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201201135409.55510-1-toke@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Toke Høiland-Jørgensen wrote on Tue, Dec 01, 2020: > The v9fs file operations were missing the splice_read operations, which > breaks sendfile() of files on such a filesystem. I discovered this while > trying to load an eBPF program using iproute2 inside a 'virtme' environment > which uses 9pfs for the virtual file system. iproute2 relies on sendfile() > with an AF_ALG socket to hash files, which was erroring out in the virtual > environment. > > Since generic_file_splice_read() seems to just implement splice_read in > terms of the read_iter operation, I simply added the generic implementation > to the file operations, which fixed the error I was seeing. A quick grep > indicates that this is what most other file systems do as well. Good catch, might as well do that. I'm surprised you didn't hit the same problem with splice_write? I see iter_file_splice_write being used for it on many filesystems, it's probably better to add both? > The only caveat is that my test case was only hitting the > v9fs_file_operations_dotl implementation. I added it to the other file > operations structs as well because it seemed like the sensible thing to do > given that they all implement read_iter, but those are only compile tested. The logic is close enough that it should work, I'll run it through in cached mode at least first though (just mount with cache=loose or cache=fscache to hit v9fs_cached_file_operations_dotl yourself if you want to) non-dotl operations are harder to test, I don't have any server compatible either so we'll have to trust it works close enough... (note you can write comments such as this one after the three dashes line before the diff chunk so maintainers can reply without having it in commit message itself) -- Dominique