linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Martin Kepplinger <martink@posteo.de>
Cc: fuse-devel <fuse-devel@lists.sourceforge.net>,
	thierry.reding@gmail.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	giedriuswork@gmail.com,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fuse: don't check for file->private_data on open().
Date: Thu, 13 Nov 2014 10:40:38 +0100	[thread overview]
Message-ID: <CAJfpegt2Xz0tGUygpN4eyb3g8EsFNWomsUUOmGBMj03ocOPVng@mail.gmail.com> (raw)
In-Reply-To: <1415809894-24084-1-git-send-email-martink@posteo.de>

On Wed, Nov 12, 2014 at 5:31 PM, Martin Kepplinger <martink@posteo.de> wrote:
> The miscdevice core now sets file->private_data to the struct miscdevice
> so don't fail when this is not NULL.

Does it?  Look:

static int misc_open(struct inode * inode, struct file * file)
{
    ...
    if (file->f_op->open) {
        file->private_data = c;
        err = file->f_op->open(inode,file);
    }

It only sets ->private_data if the device provides an open method.
Fuse doesn't, so it's not clear what this patch is trying to fix.

Thanks,
Miklos


>
> Reported-by: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> ---
> This is a question: what does this check provide and does overwriting
> file->private_data make any difference?
>
> Is open() by the user not allowed here, if file->private_data is set?
>
> thanks!!
>
>  fs/fuse/inode.c |    3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index 03246cd..562407e 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -1092,9 +1092,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
>         }
>
>         mutex_lock(&fuse_mutex);
> -       err = -EINVAL;
> -       if (file->private_data)
> -               goto err_unlock;
>
>         err = fuse_ctl_add_conn(fc);
>         if (err)
> --
> 1.7.10.4
>

  parent reply	other threads:[~2014-11-13  9:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 20:27 [Bisected] Regression: cpu stuck in gvfsd-fuse, can't shutdown Giedrius Statkevicius
2014-11-11 21:05 ` Greg KH
2014-11-11 21:44   ` Giedrius Statkevicius
2014-11-12 11:26     ` Thierry Reding
2014-11-12 16:31       ` [PATCH] fuse: don't check for file->private_data on open() Martin Kepplinger
2014-11-12 16:41         ` Martin Kepplinger
2014-11-12 17:23         ` Giedrius Statkevicius
2014-11-12 18:56           ` [PATCH] fuse: Don't check for file->private_data on open(). It is set by the core Martin Kepplinger
2014-11-13  9:40         ` Miklos Szeredi [this message]
2014-11-13 10:05           ` [PATCH] fuse: don't check for file->private_data on open() Martin Kepplinger
2014-11-13 10:53             ` Miklos Szeredi
2014-11-13 11:13               ` Martin Kepplinger
2014-11-13 15:34                 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJfpegt2Xz0tGUygpN4eyb3g8EsFNWomsUUOmGBMj03ocOPVng@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=giedriuswork@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).