lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikQt9JRp4jx9qcTEr6nKMppA8Gj3=E12aFUGUYs@mail.gmail.com>
Date:	Tue, 22 Mar 2011 10:18:59 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	apw@...onical.com, nbd@...nwrt.org, neilb@...e.de
Subject: Re: [PATCH 1/6 v7] vfs: add i_op->open()

On Tue, Mar 22, 2011 at 8:26 AM, Miklos Szeredi <miklos@...redi.hu> wrote:
>
> Add a new inode operation i_op->open().  This is for stacked
> filesystems that want to return a struct file from a different
> filesystem.

Hmm..

> +               struct inode *inode = nd->path.dentry->d_inode;
> +
> +               if (inode->i_op->open) {
> +                       int flags = filp->f_flags;
> +                       put_filp(filp);
> +                       filp = inode->i_op->open(nd->path.dentry, flags, cred);
> +               } else {
> +                       filp = __dentry_open(&nd->path, filp, NULL, cred);
> +               }

This seems broken.

Why don't you just pass in the filp to the ->open routine, and drop
that "flags" argument. Maybe other filesystems want to use ->open, but
don't want to put_filp() on the filp we already allocated, only to
allocate a new one?

It seems like you made that unnecessarily hard on purpose, with no
advantage to the interface.

                        Linus
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ