fuse: update mtime on open(O_TRUNC) in atomic_o_trunc mode
authorMaxim Patlasov <MPatlasov@parallels.com>
Mon, 28 Apr 2014 12:19:22 +0000 (14:19 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 28 Apr 2014 12:19:22 +0000 (14:19 +0200)
In case of fc->atomic_o_trunc is set, fuse does nothing in
fuse_do_setattr() while handling open(O_TRUNC). Hence, i_mtime must be
updated explicitly in fuse_finish_open(). The patch also adds extra locking
encompassing open(O_TRUNC) operation to avoid races between the truncation
and updating i_mtime.

Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/file.c

diff --cc fs/fuse/file.c
Simple merge