[U-Boot] fix: fw_env: Prevent writing error message on special files, which don't support fsync

Tom Rini trini at konsulko.com
Mon Sep 4 00:42:11 UTC 2017


On Sun, Aug 27, 2017 at 01:46:22PM +0200, Lukasz Majewski wrote:

> According to fsync specification [1] some special files (e.g., a pipe, FIFO,
> or socket) don't support synchronization and return either EROFS or EINVAL.
> 
> On the linux side the sys_fsync -> do_fsync() checks if the requested file
> has f_op->fsync defined. If not it returns EINVAL [2].
> 
> This commit prevents writing error messages for files (devices), which
> do not support fsync().
> 
> [1] - http://man7.org/linux/man-pages/man2/fsync.2.html
> [2] - http://elixir.free-electrons.com/linux/v4.13-rc6/source/fs/sync.c#L183
> 
> Signed-off-by: Lukasz Majewski <lukma at denx.de>
> Acked-by: Michael Heimpold <mhei at heimpold.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170903/d47dc28d/attachment.sig>


More information about the U-Boot mailing list