projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b93d4a0
)
ovl: fsync after copy-up
author
Miklos Szeredi
<mszeredi@redhat.com>
Mon, 31 Oct 2016 13:42:14 +0000
(14:42 +0100)
committer
Miklos Szeredi
<mszeredi@redhat.com>
Mon, 31 Oct 2016 13:42:14 +0000
(14:42 +0100)
Make sure the copied up file hits the disk before renaming to the final
destination. If this is not done then the copy-up may corrupt the data in
the file in case of a crash.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org>
fs/overlayfs/copy_up.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/overlayfs/copy_up.c
b/fs/overlayfs/copy_up.c
index aeb60f791418d6d6cba59f2dc743e8b8c71d5297..36795eed40b09ee1bbb6766e65019b8d1c6695f0 100644
(file)
--- a/
fs/overlayfs/copy_up.c
+++ b/
fs/overlayfs/copy_up.c
@@
-178,6
+178,8
@@
static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
len -= bytes;
}
+ if (!error)
+ error = vfs_fsync(new_file, 0);
fput(new_file);
out_fput:
fput(old_file);