Re: [PATCH] vfs: Add support to check max and min inode times

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux