Skip to content

read/write on attribute w/o show/store should return -ENOSYS

Dmitry Torokhov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5sysfs: if show/store is missing return -ENOSYSfs/sysfs/bin.c fs/sysfs/file.c+14 -90 replies
1/5sysfs: if show/store is missing return -EIOfs/sysfs/bin.c fs/sysfs/file.c+4 -40 replies
2/5sysfs: (driver/base) if show/store is missing return -ENOSYSdrivers/base/bus.c drivers/base/class.c drivers/base/core.c +1 more+8 -80 replies
2/5sysfs: (driver/base) if show/store is missing return -EIOdrivers/base/bus.c drivers/base/class.c drivers/base/core.c +1 more+8 -80 replies
3/5sysfs: (driver/pci) if show/store is missing return -ENOSYSdrivers/pci/hotplug/pci_hotplug_core.c drivers/pci/hotplug/rpadlpar_sysfs.c drivers/pci/pci-driver.c+17 -150 replies
3/5sysfs: (driver/pci) if show/store is missing return -EIOdrivers/pci/hotplug/pci_hotplug_core.c drivers/pci/hotplug/rpadlpar_sysfs.c drivers/pci/pci-driver.c+17 -150 replies
4/5sysfs: (driver/block) if show/store is missing return -ENOSYSdrivers/block/as-iosched.c drivers/block/cfq-iosched.c drivers/block/deadline-iosched.c +2 more+9 -90 replies
4/5sysfs: (driver/block) if show/store is missing return -EIOdrivers/block/as-iosched.c drivers/block/cfq-iosched.c drivers/block/deadline-iosched.c +2 more+9 -90 replies
5/5sysfs: (rest) if show/store is missing return -ENOSYSdrivers/acpi/scan.c drivers/cpufreq/cpufreq.c drivers/firmware/edd.c +4 more+12 -120 replies
5/5sysfs: (rest) if show/store is missing return -EIOdrivers/acpi/scan.c drivers/cpufreq/cpufreq.c drivers/firmware/edd.c +4 more+12 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC/PATCH 0/5] read/write on attribute w/o show/store should return -ENOSYS

Hi,

Jean Delvare has noticed that if a driver happens to declare its attribute as RW but doesn't provide store() method attempt to write into such attribute will cause spinning process as most of the attribute implementations return 0 in case of missing store causing endless retries. In some cases missing show/store will return -EPERM, -EACCESS or -EINVAL.

I think we should unify implementations and have them all return -ENOSYS (function not implemented) when corresponding method (show/store) is missing.

Signature · 1 line
Dmitry