[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CADa969i=cYy6CWKnYPpP-MnyAuVcS-z3hXqSRxDWLd+CBoLaLQ@mail.gmail.com>
Date: Tue, 24 Mar 2015 11:14:53 -0400
From: Sanidhya Kashyap <sanidhya.gatech@...il.com>
To: dhowells@...hat.com, viro@...iv.linux.org.uk, tytso@....edu,
minchan@...nel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: taesoo@...ech.edu, changwoo@...ech.edu,
"Kashyap, Sanidhya" <sanidhya@...ech.edu>, blee@...ech.edu,
csong84@...ech.edu
Subject: missing MS_RDONLY check in fsync
Hello everyone,
We've been cross checking various file systems for the general
inconsistencies and we have a question about the check of MS_RDONLY
during fsync.
We know that the vfs layer does not check for MS_RDONLY for fsync and
this is confirmed by the ubifs where they have explicitly mentioned
about this (commit - 3b2f9a019e655f3407e4e69cdbaf8b75699b79a4 )
"""
if (c->ro_mount)
/*
* For some really strange reasons VFS does not filter out
* 'fsync()' for R/O mounted file-systems as per 2.6.39.
*/
"""
And there is a comment in include/linux/fs.h file (line: 1688) about
the MS_RDONLY flag: (commit - bbc1096ad8e9875a025bbcf012605da49129e8b8
):
""""
* Exception: MS_RDONLY is always applied to the entire file system.
*
* Unfortunately, it is possible to change a filesystems flags with it mounted
* with files in use. This means that all of the inodes will not have their
* i_flags updated. Hence, i_flags no longer inherit the superblock mount
* flags, so these have to be checked separately. -- rmk@....uk.linux.org */
"""
Looking at the above two comments, it is quite clear that the every
file system should independently check MS_RDONLY in fsync. Some file
systems such as ext3, ext4, ubifs, ocfs2 and f2fs do it whereas others
do not.
It would be great if anyone can let us know why is there no check for
every file system or why has it not been included in the vfs layer? Is
there any particular reason for this?
Thanks,
Sanidhya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists