All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Siddharth Gupta <sidgup@codeaurora.org>
Cc: mcgrof@kernel.org, rafael@kernel.org, viro@zeniv.linux.org.uk,
	linux-fsdevel@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"psodagud@codeaurora.org" <psodagud@codeaurora.org>
Subject: Re: PROBLEM: Firmware loader fallback mechanism no longer works with sendfile
Date: Tue, 5 Jan 2021 07:36:58 +0100	[thread overview]
Message-ID: <X/QJCgoLPhfECEmP@kroah.com> (raw)
In-Reply-To: <7e6f44b1-a0d2-d1d1-9c11-dcea163f8f03@codeaurora.org>

On Mon, Jan 04, 2021 at 02:43:45PM -0800, Siddharth Gupta wrote:
> Hi all,
> 
> With the introduction of the filesystem change "fs: don't allow splice
> read/write without explicit ops"[1] the fallback mechanism of the firmware
> loader[2] no longer works when using sendfile[3] from the userspace.

What userspace program are you using to load firmware?  Are you not
using the in-kernel firmware loader for some reason?

> Since the binary attributes don't support splice_{read,write} functions the
> calls to splice_{read,write} used the default kernel_{read,write} functions.
> With the above change this results in an -EINVAL return from
> do_splice_from[4].
> 
> This essentially means that sendfile will not work for any binary attribute
> in the sysfs.

Have you tried fixing this with a patch much like what we did for the
proc files that needed this?  If not, can you?

> [1]: https://github.com/torvalds/linux/commit/36e2c7421f02a22f71c9283e55fdb672a9eb58e7#diff-70c49af2ed5805fc1406ed6e6532d6a029ada1abd90cca6442711b9cecd4d523
> [2]: https://github.com/torvalds/linux/blob/master/drivers/base/firmware_loader/main.c#L831
> [3]: https://github.com/torvalds/linux/blob/master/fs/read_write.c#L1257
> [4]: https://github.com/torvalds/linux/blob/master/fs/splice.c#L753

kernel development is on git.kernel.org, not github :)

thanks,

greg k-h

  reply	other threads:[~2021-01-05  6:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 22:43 PROBLEM: Firmware loader fallback mechanism no longer works with sendfile Siddharth Gupta
2021-01-05  6:36 ` Greg KH [this message]
2021-01-06  1:00   ` Siddharth Gupta
2021-01-06 10:33     ` Greg KH
2021-01-07 22:03       ` Siddharth Gupta
2021-01-08 14:44         ` Greg KH
2021-01-12 18:31           ` Siddharth Gupta
2021-01-15 16:20             ` Greg KH
2021-01-18  0:59               ` Siddharth Gupta
2021-01-20  9:10 ` Christoph Hellwig
2021-01-20 20:28   ` Siddharth Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X/QJCgoLPhfECEmP@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=psodagud@codeaurora.org \
    --cc=rafael@kernel.org \
    --cc=sidgup@codeaurora.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.