Skip to contentSkip to conversation

ocfs2: fix ocfs2_sync_file() if filesystem is readonly

PATCH New Younger Liu 1 participant 1 message Nov 25, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: fix ocfs2_sync_file() if filesystem is readonly

If filesystem is readonly, there is no need to flush drive's caches
or force any uncommitted transactions.

---
 fs/ocfs2/file.c |    3 +++
 1 file changed, 3 insertions(+)
fs/ocfs2/file.c +0 -0
index d54d1bf..618f18f 100644
@@ -185,6 +185,9 @@ static int ocfs2_sync_file(struct file *file, loff_t

start, loff_t end,
file->f_path.dentry->d_name.name, (unsigned long long)datasync);

+ if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
+ return 0;
+
err = filemap_write_and_wait_range(inode->i_mapping, start, end); if (err)
return err;

Signature · 1 line
1.7.9.5