[PATCH driver-core-next] sysfs: bail early from kernfs_file_mmap()to avoid spurious lockdep warning

From: Tejun Heo
Date: Tue Dec 10 2013 - 09:50:18 EST


Hello,

Yeap, I was planning to send this out earlier but was completely
passed out yesterday after the first snowboarding in over a decade. :)

The offending commit a8b14744429f isn't applicable to
driver-core-next. This was done this way because no matter what we
do, conflict is inevitable and keeping things minimal is the least
painful. The following git branch pulls driver-core-linus into
driver-core-next, resolves the conflict by ignoring the offending
commit and applies this patch on top of it to implement the equivalent
fix.

git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git driver-core-fix-lockdep-class

For some reason, I can't reproduce the spurious lockdep warning Dave
is seeing so I'm not 100% sure but this is the same behavior as the
other patch that Dave tested in the original thread, so I'm relatively
sure this is the right fix. This patch also adds comment to the
confusing if/else in the open path.

Greg, given that there will be more patches in driver-core-next, I
think it'll be best to pull driver-core-linus into driver-core-next to
avoid conflicts from the same commit. You can pull my commit or if
you pull it yourself, just take all the chunks from driver-core-next
so that the resulting fs/sysfs/file.c is unchanged compared to
driver-core-next before pull, and then apply this patch.

Thanks.

------ 8< ------