fs: devfs: forbid truncation when cdev has no truncate operation
When a cdev doesn't have a truncate callback then forbid truncation
and fail with -EPERM.
Before this we had always failed with -ENOSPC in this situation.
We checked for f->fsdev->dev.num_resources being nonzero, but this
check was absolutely meaningless. It goes back to ancient times when
the resources of a device were automatically added to devfs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 20eea93 commit 1455e221ae3023270a4716be6b47c038249955fd
@Sascha Hauer Sascha Hauer authored on 4 Feb 2019
Showing 1 changed file
View
fs/devfs.c