ANDROID: sdcardfs: Wait for file flush to complete

Sdcardfs needs to wait for the file to finish writing before returning
an error.

Backport from 3.18 to 3.10 kernel.
This commit is contained in:
syphyr 2019-07-13 21:04:31 +02:00
parent 484e304cfc
commit f7fe4074dd
1 changed files with 3 additions and 1 deletions

View File

@ -297,8 +297,10 @@ static int sdcardfs_flush(struct file *file, fl_owner_t id)
struct file *lower_file = NULL;
lower_file = sdcardfs_lower_file(file);
if (lower_file && lower_file->f_op && lower_file->f_op->flush)
if (lower_file && lower_file->f_op && lower_file->f_op->flush) {
filemap_write_and_wait(file->f_mapping);
err = lower_file->f_op->flush(lower_file, id);
}
return err;
}