ovl: Adapt ovl_dir_fsync() to updated API in ->fsync()
Subsystems (2)
PATCH 2/2 ovl: Adapt ovl_dir_fsync() to updated API in ->fsync()
Based on a proposal patch from Miklos Szeredi <[email protected]>.
Adapt ovl_dir_fsync() to recent changes in vfs-2.6.git#for-next.
Documentation/filesystems/porting says:
[mandatory]
If you have your own ->fsync() you must make sure to call
filemap_write_and_wait_range() so that all dirty pages are synced out properly. You must also keep in mind that ->fsync() is not called with i_mutex held anymore, so if you require i_mutex locking you must make sure to take it and release it yourself.
For more details see:
commit cbc4facd43b3502f644d7f01a9a48f8bec5f3e57
"fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers"
Signed-off-by Sedat Dilek <[email protected]>
--- fs/overlayfs/readdir.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
fs/overlayfs/readdir.c +3 -2
@@ -386,7 +386,8 @@ out_unlock:return res; } -static int ovl_dir_fsync (struct file *file,int datasync) +static int ovl_dir_fsync (struct file *file,loff_t start,loff_t end, +int datasync) {struct ovl_dir_file *od = file->private_data;
@@ -400,7 +401,7 @@ static int ovl_dir_fsync(struct file *file, int datasync)return PTR_ERR (od->realfile); } -return vfs_fsync (od->realfile, datasync); +return vfs_fsync_range (od->realfile, start, end, datasync); }static int ovl_dir_release (struct inode *inode,struct file *file)
Signature · 1 line
1.7.6