KVM: MMU audit: audit_mappings tweaks
[linux-2.6-block.git] / fs / namespace.c
index 277c28a63ead1b564313cd21363bec9c15b2bf2e..7230787d18b02979122218429b4bf8af59b24cf7 100644 (file)
@@ -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);