Re: [Cluster-devel] [PATCH net-next v5 11/12] socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
Deepa Dinamani writes: > SO_RCVTIMEO and SO_SNDTIMEO socket options use struct timeval > as the time format. struct timeval is not y2038 safe. > The subsequent patches in the series add support for new socket > timeout options with _NEW suffix that will use y2038 safe > data structures. Although the existing struct timeval layout > is sufficiently wide to represent timeouts, because of the way > libc will interpret time_t based on user defined flag, these > new flags provide a way of having a structure that is the same > for all architectures consistently. > Rename the existing options with _OLD suffix forms so that the > right option is enabled for userspace applications according > to the architecture and time_t definition of libc. > > Signed-off-by: Deepa Dinamani > Acked-by: Willem de Bruijn > Cc: ccaul...@redhat.com > Cc: del...@gmx.de > Cc: pau...@samba.org > Cc: r...@linux-mips.org > Cc: r...@twiddle.net > Cc: cluster-devel@redhat.com > Cc: linuxppc-...@lists.ozlabs.org > Cc: linux-al...@vger.kernel.org > Cc: linux-a...@vger.kernel.org > Cc: linux-m...@vger.kernel.org > Cc: linux-par...@vger.kernel.org > Cc: sparcli...@vger.kernel.org > --- > arch/alpha/include/uapi/asm/socket.h | 7 +-- > arch/mips/include/uapi/asm/socket.h| 6 -- > arch/parisc/include/uapi/asm/socket.h | 6 -- > arch/powerpc/include/uapi/asm/socket.h | 4 ++-- The powerpc changes look OK to me. Acked-by: Michael Ellerman (powerpc) cheers > diff --git a/arch/powerpc/include/uapi/asm/socket.h > b/arch/powerpc/include/uapi/asm/socket.h > index 94de465e0920..12aa0c43e775 100644 > --- a/arch/powerpc/include/uapi/asm/socket.h > +++ b/arch/powerpc/include/uapi/asm/socket.h > @@ -11,8 +11,8 @@ > > #define SO_RCVLOWAT 16 > #define SO_SNDLOWAT 17 > -#define SO_RCVTIMEO 18 > -#define SO_SNDTIMEO 19 > +#define SO_RCVTIMEO_OLD 18 > +#define SO_SNDTIMEO_OLD 19 > #define SO_PASSCRED 20 > #define SO_PEERCRED 21 > > diff --git a/include/uapi/asm-generic/socket.h > b/include/uapi/asm-generic/socket.h > index 2713e0fa68ef..c56b8b487c12 100644 > --- a/include/uapi/asm-generic/socket.h > +++ b/include/uapi/asm-generic/socket.h > @@ -30,8 +30,8 @@ > #define SO_PEERCRED 17 > #define SO_RCVLOWAT 18 > #define SO_SNDLOWAT 19 > -#define SO_RCVTIMEO 20 > -#define SO_SNDTIMEO 21 > +#define SO_RCVTIMEO_OLD 20 > +#define SO_SNDTIMEO_OLD 21 > #endif > > /* Security levels - as per NRL IPv6 - don't actually do anything */ > @@ -116,6 +116,8 @@ > > #if !defined(__KERNEL__) > > +#define SO_RCVTIMEO SO_RCVTIMEO_OLD > +#define SO_SNDTIMEO SO_SNDTIMEO_OLD > #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__)) > /* on 64-bit and x32, avoid the ?: operator */ > #define SO_TIMESTAMP SO_TIMESTAMP_OLD
Re: [Cluster-devel] [PATCH net-next v5 12/12] sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
Deepa Dinamani writes: > Add new socket timeout options that are y2038 safe. > > Signed-off-by: Deepa Dinamani > Acked-by: Willem de Bruijn > Cc: ccaul...@redhat.com > Cc: da...@davemloft.net > Cc: del...@gmx.de > Cc: pau...@samba.org > Cc: r...@linux-mips.org > Cc: r...@twiddle.net > Cc: cluster-devel@redhat.com > Cc: linuxppc-...@lists.ozlabs.org > Cc: linux-al...@vger.kernel.org > Cc: linux-a...@vger.kernel.org > Cc: linux-m...@vger.kernel.org > Cc: linux-par...@vger.kernel.org > Cc: sparcli...@vger.kernel.org > --- > arch/alpha/include/uapi/asm/socket.h | 12 -- > arch/mips/include/uapi/asm/socket.h | 11 +- > arch/parisc/include/uapi/asm/socket.h | 10 - > arch/sparc/include/uapi/asm/socket.h | 11 +- You touched powerpc in the previous patch but not this one. That's because we use the asm-generic version I assume. Would be good to mention in the change log though to avoid any confusion. cheers > include/uapi/asm-generic/socket.h | 11 +- > net/core/sock.c | 53 --- > 6 files changed, 83 insertions(+), 25 deletions(-) > > diff --git a/arch/alpha/include/uapi/asm/socket.h > b/arch/alpha/include/uapi/asm/socket.h > index 9826d1db71d0..0d0fddb7e738 100644 > --- a/arch/alpha/include/uapi/asm/socket.h > +++ b/arch/alpha/include/uapi/asm/socket.h > @@ -119,19 +119,25 @@ > #define SO_TIMESTAMPNS_NEW 64 > #define SO_TIMESTAMPING_NEW 65 > > -#if !defined(__KERNEL__) > +#define SO_RCVTIMEO_NEW 66 > +#define SO_SNDTIMEO_NEW 67 > > -#define SO_RCVTIMEO SO_RCVTIMEO_OLD > -#define SO_SNDTIMEO SO_SNDTIMEO_OLD > +#if !defined(__KERNEL__) > > #if __BITS_PER_LONG == 64 > #define SO_TIMESTAMP SO_TIMESTAMP_OLD > #define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD > #define SO_TIMESTAMPING SO_TIMESTAMPING_OLD > + > +#define SO_RCVTIMEO SO_RCVTIMEO_OLD > +#define SO_SNDTIMEO SO_SNDTIMEO_OLD > #else > #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW) > #define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW) > #define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW) > + > +#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW) > +#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW) > #endif > > #define SCM_TIMESTAMP SO_TIMESTAMP > diff --git a/arch/mips/include/uapi/asm/socket.h > b/arch/mips/include/uapi/asm/socket.h > index 96cc0e907f12..eb9f33f8a8b3 100644 > --- a/arch/mips/include/uapi/asm/socket.h > +++ b/arch/mips/include/uapi/asm/socket.h > @@ -130,18 +130,25 @@ > #define SO_TIMESTAMPNS_NEW 64 > #define SO_TIMESTAMPING_NEW 65 > > +#define SO_RCVTIMEO_NEW 66 > +#define SO_SNDTIMEO_NEW 67 > + > #if !defined(__KERNEL__) > > -#define SO_RCVTIMEO SO_RCVTIMEO_OLD > -#define SO_SNDTIMEO SO_SNDTIMEO_OLD > #if __BITS_PER_LONG == 64 > #define SO_TIMESTAMP SO_TIMESTAMP_OLD > #define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD > #define SO_TIMESTAMPING SO_TIMESTAMPING_OLD > + > +#define SO_RCVTIMEO SO_RCVTIMEO_OLD > +#define SO_SNDTIMEO SO_SNDTIMEO_OLD > #else > #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW) > #define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW) > #define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW) > + > +#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW) > +#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW) > #endif > > #define SCM_TIMESTAMP SO_TIMESTAMP > diff --git a/arch/parisc/include/uapi/asm/socket.h > b/arch/parisc/include/uapi/asm/socket.h > index 046f0cd9cce4..16e428f03526 100644 > --- a/arch/parisc/include/uapi/asm/socket.h > +++ b/arch/parisc/include/uapi/asm/socket.h > @@ -111,18 +111,24 @@ > #define SO_TIMESTAMPNS_NEW 0x4039 > #define SO_TIMESTAMPING_NEW 0x403A > > +#define SO_RCVTIMEO_NEW 0x4040 > +#define SO_SNDTIMEO_NEW 0x4041 > + > #if !defined(__KERNEL__) > > -#define SO_RCVTIMEO SO_RCVTIMEO_OLD > -#define SO_SNDTIMEO SO_SNDTIMEO_OLD > #if __BITS_PER_LONG == 64 > #define SO_TIMESTAMP SO_TIMESTAMP_OLD > #define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD > #define SO_TIMESTAMPING SO_TIMESTAMPING_OLD > +#define SO_RCVTIMEO SO_RCVTIMEO_OLD > +#define SO_SNDTIMEO SO_SNDTIMEO_OLD > #else > #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? > SO_TIMESTAMP_OLD :