Re: [GIT PULL] Preparation for BKL'ed ioctl removal

Previous thread: [ANNOUNCE] Guilt v0.33 by jeffpc on Thursday, April 15, 2010 - 8:10 pm. (1 message)

Next thread: [GIT PULL] Preparation for BKL'ed ioctl removal by Frederic Weisbecker on Thursday, April 15, 2010 - 8:56 pm. (36 messages)
From: Frederic Weisbecker
Date: Thursday, April 15, 2010 - 8:55 pm

Linus,

In order to stop the bkl contagion in ioctl and push the
bkl from Vfs to the drivers that don't implement a proper
unlock_ioctl, this patch proposes to add a new "locked_ioctl"
field in struct file_operation.

This field is never called from vfs and requires to assign a
new "deprecated_ioctl" helper to the unlocked_ioctl field.
This deprecated_ioctl() helper then calls the locked_ioctl()
callback with the bkl held.

The point of doing this is to change every users of fops::ioctl
to the new scheme. Once there is no more users of the ioctl field,
we'll then be able to remove it.

Also this change brings a new config BKL which is always
enabled for now. Every drivers that use the bkl through
explicit lock_kernel() calls or by using deprecated_ioctl()
will have to select CONFIG_BKL.

Once we get no more uses of the bkl from the core features but
only on individual drivers, config BKL can be turned off
by default and selected by those drivers if needed, relegating
the bkl as an obsolete library for poor old drivers.

And given the work happening currently (tty mutex, vfs pushdowns,
procfs bkl removal, llseek janitorials, etc...), this may happen
sooner than was expected.

Now the point of having this patch in 2.6.34 is to turn
the old ioctl implementations to the new scheme in a set
of patches that relevant maintainers can apply to their
tree (or apply by ourself for unmaintained areas) for .35
Otherwise we would need to queue everything in a single
tree that may bring conflicts in the next merge window.

This single patch has very few chances to bring any regressions.

Please pull the bkl/ioctl branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	bkl/ioctl

Thanks,
	Frederic
---

Arnd Bergmann (1):
      vfs: Introduce CONFIG_BKL and deprecated_ioctl


 fs/ioctl.c               |   22 ++++++++++++++++++++++
 include/linux/fs.h       |    3 +++
 include/linux/smp_lock.h |    4 ++++
 ...
From: Frederic Weisbecker
Date: Thursday, April 15, 2010 - 8:58 pm

Sorry,

I made a mistake with the recipient in my script :-s

--

From: Jan Blunck
Date: Monday, April 19, 2010 - 5:30 am

Any specific reason why the default llseek() is in this patch?

Regards,
	Jan

-- 
Jan Blunck <jblunck@suse.de>
--

From: fweisbec
Date: Monday, April 19, 2010 - 5:52 am

Because this comes along the same kind of bkl preparation work
we want to do. The goal is to isolate default_llseek and deprecated_ioctl
and only enable them if CONFIG_BKL.

Hence we want their declaration in smp_lock.h

That said it is probably not needed to get the default_llseek declaration
here for this release.

I'm going to make a v2 and resend the pull request. Thanks.

--

From: Arnd Bergmann
Date: Monday, April 19, 2010 - 7:27 am

A later patch moves both default_llseek and deprecated_ioctl into the new
bkl.ko module, while this is just the minimal preparation for getting
all the users changed.

It was intentional but not important to do the move now.

	Arnd
--

Previous thread: [ANNOUNCE] Guilt v0.33 by jeffpc on Thursday, April 15, 2010 - 8:10 pm. (1 message)

Next thread: [GIT PULL] Preparation for BKL'ed ioctl removal by Frederic Weisbecker on Thursday, April 15, 2010 - 8:56 pm. (36 messages)