Skip to content
Commit 3dc3afad authored by Tal Shorer's avatar Tal Shorer Committed by Christoph Hellwig
Browse files

configfs: don't set buffer_needs_fill to zero if show() returns error



A confgifs attribute's show() callback is called once the first time
the user attempts to read from it. If it returns an error, that
error is returned to the user. However, the open file's
buffer_needs_fill is still set to zero and consecutive read() calls
will find an empty buffer that doesn't need filling and return 0 to
the user. This could give the user the wrong impression that the
attribute was read successfully.

Fix this by not setting buffer_needs_fill if show() returns an error,
making consecutive read() calls call show() again and either get an
error again or get data.

Signed-off-by: default avatarTal Shorer <tal.shorer@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent ee40fb29
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment