All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: jon ernst <jonernst07@gmail.com>,
	linux-ext4@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] vfs: add missing check for __O_TMPFILE in fcntl_init() (Re: [PATCH] ext4: fix...)
Date: Mon, 29 Jul 2013 14:17:05 +0800	[thread overview]
Message-ID: <20130729061705.GA17784@gmail.com> (raw)
In-Reply-To: <20130725001319.GA12994@gmail.com>

[To linux-fsdevel mailing list]

On Thu, Jul 25, 2013 at 08:13:19AM +0800, Zheng Liu wrote:
[...]
> > Also, about this code:
> > 
> > /* a horrid kludge trying to make sure that this will fail on old kernels */
> > #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
> > 
> > why not doing something like this:
> > 
> > #ifndef O_TMPFILE
> > /* a horrid kludge trying to make sure that this will fail on old kernels */
> > #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
> > #endif
> 
> Sorry, I don't take a closer look at that thread.  I look at the code,
> and it seems that there is no any rule about adding '#ifndef XXX'.
> Meanwhile, I notice a comment:
> 
> /*
>  * When introducing new O_* bits, please check its uniqueness in fcntl_init().
>  */
> 
> But we are missing adding O_TMPFILE flag in fcntl_init().  So I attach a
> patch below.
> 
> Al, could you please answer this question?  Thanks.
> 
> Regards,
>                                                 - Zheng
> 
> Subject: [PATCH] vfs: add missing check for __O_TMPFILE in fcntl_init()
> 
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> As comment in include/uapi/asm-generic/fcntl.h described, when
> introducing new O_* bits, we need to check its uniqueness in
> fcntl_init().  But __O_TMPFILE bit is missing.  So fix it.
> 
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Any comment?

Thanks,
                                                - Zheng

> ---
> *This patch is against ext4/dev tree.*
> 
>  fs/fcntl.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/fcntl.c b/fs/fcntl.c
> index 6599222..65343c3 100644
> --- a/fs/fcntl.c
> +++ b/fs/fcntl.c
> @@ -730,14 +730,14 @@ static int __init fcntl_init(void)
>  	 * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY
>  	 * is defined as O_NONBLOCK on some platforms and not on others.
>  	 */
> -	BUILD_BUG_ON(19 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
> +	BUILD_BUG_ON(20 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
>  		O_RDONLY	| O_WRONLY	| O_RDWR	|
>  		O_CREAT		| O_EXCL	| O_NOCTTY	|
>  		O_TRUNC		| O_APPEND	| /* O_NONBLOCK	| */
>  		__O_SYNC	| O_DSYNC	| FASYNC	|
>  		O_DIRECT	| O_LARGEFILE	| O_DIRECTORY	|
>  		O_NOFOLLOW	| O_NOATIME	| O_CLOEXEC	|
> -		__FMODE_EXEC	| O_PATH
> +		__FMODE_EXEC	| O_PATH	| __O_TMPFILE
>  		));
>  
>  	fasync_cache = kmem_cache_create("fasync_cache",
> -- 
> 1.7.9.7
> 

      parent reply	other threads:[~2013-07-29  6:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 16:19 kernel BUG at fs/ext4/namei.c:2572! Dave Jones
2013-07-19  1:17 ` Zheng Liu
2013-07-19 12:14 ` [PATCH] ext4: fix a bug when we try to open a file with O_TMPFILE flag Zheng Liu
2013-07-19 19:31   ` Darrick J. Wong
2013-07-19 20:01     ` Dave Jones
2013-07-19 23:36   ` Al Viro
2013-07-20 16:37     ` Zheng Liu
2013-07-21  0:56       ` Theodore Ts'o
2013-07-21  2:45     ` [GIT PULL] " Theodore Ts'o
2013-07-21  3:16       ` Linus Torvalds
2013-07-23  7:51   ` jon ernst
2013-07-23  9:59     ` Zheng Liu
2013-07-23 13:39       ` jon ernst
2013-07-23 23:38         ` Zheng Liu
2013-07-24 21:58           ` jon ernst
2013-07-25  0:13             ` [PATCH] vfs: add missing check for __O_TMPFILE in fcntl_init() (Re: [PATCH] ext4: fix...) Zheng Liu
2013-07-25  1:17               ` jon ernst
2013-07-29  6:17               ` Zheng Liu [this message]

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=20130729061705.GA17784@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=jonernst07@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.