summaryrefslogtreecommitdiff
path: root/fs/ubifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/file.c')
-rw-r--r--fs/ubifs/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index d77db7e3648..fe14f4df4ca 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1309,6 +1309,9 @@ int ubifs_fsync(struct file *file, int datasync)
dbg_gen("syncing inode %lu", inode->i_ino);
+ if (inode->i_sb->s_flags & MS_RDONLY)
+ return 0;
+
/*
* VFS has already synchronized dirty pages for this inode. Synchronize
* the inode unless this is a 'datasync()' call.