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]
Date:	Fri, 11 Sep 2009 01:07:55 +0200
From:	Andreas Dilger <adilger@....com>
To:	Christoph Hellwig <hch@....de>
Cc:	Jan Kara <jack@...e.cz>, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, akpm@...ux-foundation.org,
	drepper@...hat.com, viro@...iv.linux.org.uk, kyle@...artin.ca
Subject: Re: [PATCH 18/16] implement posix O_SYNC and O_DSYNC semantics

On Sep 10, 2009  22:25 +0200, Christoph Hellwig wrote:
> +/*
> + * Before Linux 2.6.32 only O_DSYNC semantics were implemented, but using
> + * the O_SYNC flag.  We continue to use the existing numerical value
> + * for O_DSYNC semantics now, but using the correct symbolic name for it.
> + * This new value is used to request true Posix O_SYNC semantics.  It is
> + * defined in this strange way to make sure applications compiled against
> + * new headers get at least O_DSYNC semantics on older kernels.
> + *
> + * This has the nice side-effect that we can simply test for O_DSYNC
> + * wherever we do not care if O_DSYNC or O_SYNC is used.
> +
> + * Note: __O_SYNC must never be used directly.

Doesn't it make sense that applications that actually know what they are
doing may want to start using __O_SYNC directly at some point in the
future?  It makes sense to code the kernel to handle both of these flags
appropriately (i.e. if __O_SYNC is set, but O_DSYNC is not then treat
this as the proper "O_SYNC").

> Index: linux-2.6/arch/alpha/include/asm/fcntl.h
> ===================================================================
> --- linux-2.6.orig/arch/alpha/include/asm/fcntl.h	2009-09-10 16:31:47.720004025 -0300
> +++ linux-2.6/arch/alpha/include/asm/fcntl.h	2009-09-10 16:33:55.087294444 -0300
>  #define O_CLOEXEC	010000000 /* set close_on_exec */
> +#define __O_SYNC	010000000

These two flags have the same value...

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

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