Re: [PATCH] writeback: guard against jiffies wraparound on inode->dirtied_when checks (try #2)

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

 



On Tue, 31 Mar 2009 20:03:59 -0400
Jeff Layton <jlayton@xxxxxxxxxx> wrote:

> +		 * It's not sufficient to just do a time_after() check on
> +		 * dirtied_when. That assumes that dirtied_when will always
> +		 * change within a period of jiffies that encompasses half the
> +		 * machine word size (2^31 jiffies on 32-bit arch). That's not
> +		 * necessarily the case if an inode is being constantly
> +		 * redirtied. Since dirtied_when can never be in the future,
> +		 * we can assume that if it appears to be so then it is
> +		 * actually in the distant past.

so this really is a 32-bit-only thing.

I guess that isn't worth optimising for though.

otoh, given that all three comparisons are the same:

+			time_after(inode->dirtied_when, *older_than_this) &&
+			time_before_eq(inode->dirtied_when, jiffies))

(although one is inverted (i think?)), it might end up nicer if this was all done
in a little helper function?

That way we only need to comment what's going on at a single site, and
we could omit the additional test if !CONFIG_64BIT.
--
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