Re: [PATCH] gpio: chardev: Return error for seek operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/30/2016 01:05 PM, Lars-Peter Clausen wrote:
> ...
> noop_llseek() is primarily meant for
> devices that can not support seek, but where there might be a user that
> depends on the seek() operation succeeding. For newly added devices that
> can not support seek operations it is recommended to use no_llseek(), which
> will return an error. For more information see commit 6038f373a3dc
> ("llseek: automatically add .llseek fop").
> ...

Arnd, on this subject. As far as I can see FMODE_SEEK is only set if the
file was created using sys_open() or a equivalent operation. Files that are
created using other system calls (e.g. like pipe(), eventfd()) or IOCTLs
(like for the GPIO line and event handles) do not have FMODE_SEEK set. If
FMODE_SEEK is not set vfs_seek() will ignore the fops llseek() callback and
always use no_llseek(). Many of these files that don't have FMODE_SEEK set
still use noop_llseek(). Partially introduced by your commit, partially
spread by copy and paste.

Since the llseek field is ignored for those, what is your recommendation
here? Drop the llseek initialization or change it to no_llseek? And if it is
the later what is the reason that it should not be removed even if the field
is never used?

Thanks,
- Lars

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux