[lkml]   [2014]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] btrfs: Don't check for file->private_data on open(). It is set by the core.
The miscdevice core now sets file->private_data to the struct miscdevice
so don't fail when this is not NULL.

Signed-off-by: Martin Kepplinger <>
This is a question: what does this check provide and does overwriting
file->private_data make any difference?

Is miscdevice's open() by the user not allowed here, if file->private_data
is set?


fs/btrfs/ioctl.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 4399f0c..066ce41 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3752,10 +3752,6 @@ static long btrfs_ioctl_trans_start(struct file *file)
if (!capable(CAP_SYS_ADMIN))
goto out;

- if (file->private_data)
- goto out;
ret = -EROFS;
if (btrfs_root_readonly(root))
goto out;

 \ /
  Last update: 2014-11-12 18:21    [W:0.036 / U:4.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site