All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	y2038@lists.linaro.org, Alexander Viro <viro@zeniv.linux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH v2] vfs: Add support to check max and min inode times
Date: Thu, 03 Mar 2016 17:03:11 +0100	[thread overview]
Message-ID: <27027369.MPMOSttCfe@wuerfel> (raw)
In-Reply-To: <CABeXuvqkoL_acg-xW9a1KTQ3MmdeakOkQo=pzWVW+ecnqCtBdg@mail.gmail.com>

On Thursday 03 March 2016 21:08:25 Deepa Dinamani wrote:
> On Thu, Mar 3, 2016 at 7:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 02 March 2016 23:50:01 Deepa Dinamani wrote:
> >> +       /*
> >> +        * Assign a default empty range [MAX_VFS_TIME, MIN_VFS_TIME].
> >> +        * This will help VFS detect filesystems that do not populate
> >> +        * these fields in the superblock.
> >> +        */
> >> +       s->s_time_min = MAX_VFS_TIME;
> >> +       s->s_time_max = MIN_VFS_TIME;
> >>         s->cleancache_poolid = CLEANCACHE_NO_POOL;
> >
> > I think this is still less clear than it should be, even with the
> > comment explaining it.
> >
> > As I just replied to Dave, how about initializing both to -1 instead?
> 
> This was one of my first ideas.
> The reason I did not choose this is because
> 1. [-1, -1] is a valid range theoretically.
> 2. -1 would now be treated as a value.
> 
> It is true that no filesystem is using -1 as a limit.
> But, I did not feel right excluding a perfectly good value.
> Choosing [1,1] or any other number except probably 0 would work the same way.
> 
> This is the reason that I decided an invalid range should be
> represented by an invalid tuple and
> not a single value.
> My premise was that a range where min_time > max_time is invalid.

Right.

> My first choice here as in the first patch I shared with you privately
> was [1,-1].
> But, the condition min_time < max_time can easily be achieved by
> changing just one of the values.
> For instance, [1, 2016]. But, this doesn't necessarily mean that the
> filesystem explicitly set both the values.

I see where you are coming from here, but I think we could also assume
some minimum level of competence from the file system developers, so
I would not have quite described it this way ;-)

> For this reason, the invalid range I chose is [max_time, min_time].
> Of course [min_time, min_time] and [max_time, max_time] ranges are
> also considered valid in this approach.
> 
> This guarantees
> 1. That both min and max values are assigned by each filesystem.
> 2. The range is universally invalid.

Ok, at least it clearly shows the intention that it cannot possibly
be valid, unlike the '0' or '-1' defaults.

	Arnd

  reply	other threads:[~2016-03-03 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03  7:50 [PATCH v2] vfs: Add support to check max and min inode times Deepa Dinamani
2016-03-03 14:10 ` Arnd Bergmann
2016-03-03 15:38   ` Deepa Dinamani
2016-03-03 16:03     ` Arnd Bergmann [this message]
2016-03-03 17:33       ` Deepa Dinamani
2016-03-17 21:48 ` Alex Elder

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=27027369.MPMOSttCfe@wuerfel \
    --to=arnd@arndb.de \
    --cc=david@fromorbit.com \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.org \
    /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.