]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fuse: fix fuse_write_end() if zero bytes were copied
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 18 Aug 2016 07:10:44 +0000 (09:10 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:33 +0000 (03:54 +0000)
commitf578da7993474f470fca4dac8bf562026ff2543c
tree26932acbee73f33e775f5c2af45a756b1c622596
parent8eb21f2c4ac39e538b2128f5df1e1ebc6f5536ee
fuse: fix fuse_write_end() if zero bytes were copied

commit 59c3b76cc61d1d676f965c192cc7969aa5cb2744 upstream.

If pos is at the beginning of a page and copied is zero then page is not
zeroed but is marked uptodate.

Fix by skipping everything except unlock/put of page if zero bytes were
copied.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: 6b12c1b37e55 ("fuse: Implement write_begin/write_end callbacks")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/fuse/file.c