Re: [PATCH] misc: pass miscdevice through file's private_data
From: Tom Van Braeckel
Date: Sun Jan 11 2015 - 10:45:07 EST
> Wait, didn't this break FUSE? Or was that some other variant of this
> patch?
You're right. How come I missed this?
I traced back my steps and as stated, I had reviewed all relevant code in the
"drivers" folder. And therein lies the problem: I didn't think of reviewing the
code in the "fs" folder, hence I missed fuse. I also went over the history of
misc.c, but I used the default "git log", which pruned the reverted commits,
while I should have used git log --full-history.
I'm sorry I missed this... and I'm not giving up :-)
I spent the whole day re-doing the investigation, checking *all* relevant code
this time. The code in arch, fs, lib, net and virt uses misc_register, but most
code is safe because it either registers a custom open() file operation or it
doesn't rely on private_data being initialized to NULL when it didn't.
And yes, I did find *one* additional case that is affected; btrfs' transaction
starting and stopping ioctl code in fs/btrfs/super.c uses private_data to store
the transaction, and relies on the fact that it is NULL initially. This only
works because btrfs doesn't register a custom open() file operation for this
device file.
I'm currently testing out patches to make fuse and btrfs independent of this
subtle behavior of the misc subsystem. I'll send my patches to the fuse and
btrfs maintainers first and when they get accepted, I'll re-send this patch to
misc.
Kind regards and thanks for the feedback,
Tom Van Braeckel.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/