Skip to content
Commit a01ac27b authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

fs: check FMODE_WRITE in __kernel_write



Add a WARN_ON_ONCE if the file isn't actually open for write.  This
matches the check done in vfs_write, but actually warn warns as a
kernel user calling write on a file not opened for writing is a pretty
obvious programming error.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 9db97752
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment