[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100520233942.GA1086@ecryptfs>
Date: Thu, 20 May 2010 18:39:42 -0500
From: Tyler Hicks <tyhicks@...ux.vnet.ibm.com>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
Dustin Kirkland <kirkland@...onical.com>,
Ecryptfs <ecryptfs-devel@...ts.launchpad.net>,
Thomas Gleixner <tglx@...utronix.de>,
John Kacur <jkacur@...hat.com>, Arnd Bergmann <arnd@...db.de>,
Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH 1/8] ecryptfs: Pushdown the bkl from ioctl
On Wed May 19, 2010 at 07:24:08PM +0200, Frederic Weisbecker (fweisbec@...il.com) was quoted:
> Pushdown the bkl to ecryptfs_ioctl.
I've been sitting on a bug fix for a while that cleans up the eCryptfs
ioctl code. eCryptfs doesn't need the BKL itself and can leave that
decision up to the lower file sytem. The patch I have written should
cover what you're trying to do here, too. I'll respond with the patch
and if you think it looks good, I'll carry it in my tree and ask Linus
to pull soon.
I reuse vfs_ioctl(), which must be exported, so I should get Al's ack.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Tyler Hicks <tyhicks@...ux.vnet.ibm.com>
> Cc: Dustin Kirkland <kirkland@...onical.com>
> Cc: Ecryptfs <ecryptfs-devel@...ts.launchpad.net>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: John Kacur <jkacur@...hat.com>
> Cc: Arnd Bergmann <arnd@...db.de>
> ---
> fs/ecryptfs/file.c | 23 ++++++++++++++++++-----
> 1 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
> index e7440a6..9352613 100644
> --- a/fs/ecryptfs/file.c
> +++ b/fs/ecryptfs/file.c
> @@ -294,12 +294,12 @@ static int ecryptfs_fasync(int fd, struct file *file, int flag)
> return rc;
> }
>
> -static int ecryptfs_ioctl(struct inode *inode, struct file *file,
> +static long ecryptfs_ioctl(struct file *file,
> unsigned int cmd, unsigned long arg);
>
> const struct file_operations ecryptfs_dir_fops = {
> .readdir = ecryptfs_readdir,
> - .ioctl = ecryptfs_ioctl,
> + .unlocked_ioctl = ecryptfs_ioctl,
> .open = ecryptfs_open,
> .flush = ecryptfs_flush,
> .release = ecryptfs_release,
> @@ -315,7 +315,7 @@ const struct file_operations ecryptfs_main_fops = {
> .write = do_sync_write,
> .aio_write = generic_file_aio_write,
> .readdir = ecryptfs_readdir,
> - .ioctl = ecryptfs_ioctl,
> + .unlocked_ioctl = ecryptfs_ioctl,
> .mmap = generic_file_mmap,
> .open = ecryptfs_open,
> .flush = ecryptfs_flush,
> @@ -326,8 +326,8 @@ const struct file_operations ecryptfs_main_fops = {
> };
>
> static int
> -ecryptfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
> - unsigned long arg)
> +ecryptfs_ioctl_unlocked(struct inode *inode, struct file *file,
> + unsigned int cmd, unsigned long arg)
> {
> int rc = 0;
> struct file *lower_file = NULL;
> @@ -341,3 +341,16 @@ ecryptfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
> rc = -ENOTTY;
> return rc;
> }
> +
> +static long ecryptfs_ioctl(struct file *file, unsigned int cmd,
> + unsigned long arg)
> +{
> + long ret;
> + struct inode *inode = file->f_dentry->d_inode;
> +
> + lock_kernel();
> + ret = ecryptfs_ioctl_unlocked(inode, file, cmd, arg);
> + unlock_kernel();
> +
> + return ret;
> +}
> --
> 1.6.2.3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists