From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ipmail06.adl2.internode.on.net ([150.101.137.129]:3792 "EHLO ipmail06.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756005AbcCBWTJ (ORCPT ); Wed, 2 Mar 2016 17:19:09 -0500 Date: Thu, 3 Mar 2016 09:19:05 +1100 From: Dave Chinner To: Deepa Dinamani Cc: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org, viro@zeniv.linux.org.uk, tglx@linutronix.de, arnd@arndb.de Subject: Re: [PATCH] vfs: Add support to check max and min inode times Message-ID: <20160302221905.GO29057@dastard> References: <1456933894-17001-1-git-send-email-deepa.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456933894-17001-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Mar 02, 2016 at 07:51:34AM -0800, Deepa Dinamani wrote: > MAX_INVALID_VFS_TIME and MIN_INVALID_VFS_TIME are initialized to S64_MIN > and S64_MAX respectively so that even if one of the fields is > uninitialized, it can be detected by using the condition > max_time < min_time. I can't work out what MIN/MAX_INVALID_VFS_TIME is supposed to mean when I see it in the code. does it mean time that lies between MIN_INVALID_VFS_TIME > time > MAX_INVALID_VFS_TIME is invalid (unlikely, but that's the obvious reading :)? Or that time < MIN_INVALID_VFS_TIME is invalid? Or is it valid? I can't tell... Normally limits are specified by "min valid" and "max valid" defines, which are pretty clear in their meaning. Like: > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -927,6 +927,12 @@ static inline struct file *get_file(struct file *f) > #define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffLL) > #endif > > +#define MAX_VFS_TIME S64_MAX > +#define MIN_VFS_TIME S64_MIN These. Anything ouside these ranges is invalid. As such, I think this is wrong for 32 bit systems as the min/max VFS times right now are S32_MAX/S32_MIN... Cheers, Dave. -- Dave Chinner david@fromorbit.com