projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
79040ca
)
ocfs2: fix ocfs2_sync_file() if filesystem is readonly
author
Younger Liu
<
[email protected]
>
Mon, 10 Feb 2014 22:25:44 +0000
(14:25 -0800)
committer
Linus Torvalds
<
[email protected]
>
Tue, 11 Feb 2014 00:01:42 +0000
(16:01 -0800)
If filesystem is readonly, there is no need to flush drive's caches or
force any uncommitted transactions.
[
[email protected]
: return -EROFS, not 0]
Signed-off-by: Younger Liu <
[email protected]
>
Cc: Joel Becker <
[email protected]
>
Cc: Mark Fasheh <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/ocfs2/file.c
patch
|
blob
|
history
diff --git
a/fs/ocfs2/file.c
b/fs/ocfs2/file.c
index d77d71ead8d12071a52b1f0f63c66f1077c93f84..fcd970636bbfb2a4800677e4e030dd1ed969455d 100644
(file)
--- a/
fs/ocfs2/file.c
+++ b/
fs/ocfs2/file.c
@@
-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 -EROFS;
+
err = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (err)
return err;