Re: [PATCH v2 2/3] fs/resctrl: Return -EINVAL for a missing seq_show implementation

Aaron Tomlin
2025-12-18T23:12:50Z

On Tue, Dec 16, 2025 at 09:02:27PM -0800, Reinette Chatre wrote:
> Hi Aaron,

Hi Reinette,

Thank you for your enquiry regarding the necessity of this specific change.

> How is this change required to support the feature of enabling user to
> set CBM across domains?

To be quite candid, this particular patch does not constitute a strict
prerequisite for the core functionality. The primary feature can, in
technical terms, operate without it.

However, it is important to note that this change was proposed as part of
the broader patchset.

> On 12/15/25 3:02 PM, Aaron Tomlin wrote:
> > The rdtgroup_seqfile_show() function, which is the sequence file handler
> > for reading data from resctrl files, previously returned 0 (success) if
> > the file's associated rftype did not define a .seq_show implementation.
> >
> > This behavior is incorrect and confusing, as a read operation that
> > does not define a display function should be treated as an error.
>
> Why should it be treated as an error? Not having rftype::seq_show() set when
> user is intended to be able to see data when reading from the file is a kernel
> bug. Otherwise it seems fine to return nothing when there is nothing to show
> and doing so be successful.

To provide some context on my initial reasoning, I found it somewhat
unorthodox to attempt to access an interface that effectively does not
exist (in this case, a missing seq_show callback) without the kernel
returning an explicit error, such as -EINVAL. My instinct was to signal
that the operation was invalid rather than allowing a silent, successful
"empty" read.

However, I take your point entirely. If the intention is that a lack of
data should simply result in a successful return with no output, then the
current behaviour is indeed acceptable.

I shall revert this change from the series.

Kind rgards,
--
Aaron Tomlin