mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
vfs: mnt_want_write_file(): fix special file handling
I suspect that mnt_want_write_file() may have wrong assumption. I think mnt_want_write_file() is assuming it increments ->mnt_writers if (file->f_mode & FMODE_WRITE). But, if it's special_file(), it is false? Signed-off-by: OGAWA Hirofumi <[email protected]> Acked-by: Dave Hansen <[email protected]> Cc: Al Viro <[email protected]> Cc: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
69130c7cf9
commit
2d8dd38a5a
1 changed files with 2 additions and 1 deletions
|
|
@ -316,7 +316,8 @@ EXPORT_SYMBOL_GPL(mnt_clone_write);
|
|||
*/
|
||||
int mnt_want_write_file(struct file *file)
|
||||
{
|
||||
if (!(file->f_mode & FMODE_WRITE))
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode))
|
||||
return mnt_want_write(file->f_path.mnt);
|
||||
else
|
||||
return mnt_clone_write(file->f_path.mnt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue