If the filesystem is mounted as read-only then return from that point itself
instead of first doing a writeout/wait and then checking for read-only
condition.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
.for_reclaim = 0,
};
+ if (inode->i_sb->s_flags & MS_RDONLY)
+ return 0;
+
ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (ret)
return ret;
mutex_lock(&inode->i_mutex);
- if (inode->i_sb->s_flags & MS_RDONLY)
- goto out;
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
goto out;