Re: [PATCH v4 2/4] fs: debugfs: Add write functionality to debugfs blobs

From: Greg KH
Date: Fri Jun 23 2023 - 04:09:36 EST


On Wed, Jun 21, 2023 at 03:51:00AM +0000, Avadhut Naik wrote:
> From: Avadhut Naik <Avadhut.Naik@xxxxxxx>
>
> Currently, debugfs_create_blob() creates read-only debugfs binary blob
> files.
>
> In some cases, however, userspace tools need to write variable length
> data structures into predetermined memory addresses. An example is when
> injecting Vendor-defined error types through the einj module. In such
> cases, the functionality to write to these blob files in debugfs would
> be desired since the mapping aspect can be handled within the modules
> with userspace tools only needing to write into the blob files.
>
> Implement a write callback to enable writing to these blob files in
> debugfs.
>
> Signed-off-by: Avadhut Naik <Avadhut.Naik@xxxxxxx>
> Reviewed-by: Alexey Kardashevskiy <aik@xxxxxxx>

Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>