Skip to contentSkip to conversation

ocfs2-fix-ocfs2_sync_file-if-filesystem-is-readonly.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 11, 2014 OCFS2

lore
Share & tools
lore
#0 lore raw

Subject: [merged] ocfs2-fix-ocfs2_sync_file-if-filesystem-is-readonly.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 11 Feb 2014 11:23:38 -0800

The patch titled
Subject: ocfs2: fix ocfs2_sync_file() if filesystem is readonly
has been removed from the -mm tree. Its filename was
ocfs2-fix-ocfs2_sync_file-if-filesystem-is-readonly.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Younger Liu <[email protected]>
Subject: 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.

[[email protected]: return -EROFS, not 0]
Cc Joel Becker <[email protected]>
Cc Mark Fasheh <[email protected]>

---

 fs/ocfs2/file.c |    3 +++
 1 file changed, 3 insertions(+)
fs/ocfs2/file.c renamed from fs/ocfs2/file.c~ocfs2-fix-ocfs2_sync_file-if-filesystem-is-readonly +3 -0
diff -puN fs/ocfs2/file.c~ocfs2-fix-ocfs2_sync_file-if-filesystem-is-readonly fs/ocfs2/file.c
@@ -185,6 +185,9 @@ static int ocfs2_sync_file(struct file *
 			      file->f_path.dentry->d_name.name,
 			      (unsigned long long)datasync);
 
+	if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
+		return -EROFS;
+
 	err = filemap_write_and_wait_range(inode->i_mapping, start, end);
 	if (err)
 		return err;

_

Patches currently in -mm which might be from [email protected] are

origin.patch