Re: [PATCH 1/4] fs/autofs: Use time_before, time_before_eq, etc.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Julia Lawall <julia@...>
Cc: <hpa@...>, <autofs@...>, <linux-kernel@...>, <kernel-janitors@...>
Date: Wednesday, December 26, 2007 - 3:58 pm

On Dec 26, 2007 7:21 AM, Julia Lawall <julia@diku.dk> wrote:

I don't think this is a safe change? subtraction is always safe (if
you think about it as 'distance'), addition isn't always safe unless
you know the range. The time_before macro will expand that out to
(effectively):

  if ( (long)(ent->last_usage + timeout) - (long)(jiffies) < 0 )

which seems to introduce an overflow condition in the first term.

Dunno, I may be wrong (happens often), but at the very least what
you've transformed it into is no longer obviously correct, and so it's
not a great change.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/4] fs/autofs: Use time_before, time_before_eq, ..., Ray Lee, (Wed Dec 26, 3:58 pm)
Re: [autofs] [PATCH 1/4] fs/autofs: Use time_before, time_be..., Fabio Olive Leite, (Fri Dec 28, 10:21 am)
Re: [PATCH 1/4] fs/autofs: Use time_before, time_before_eq, ..., YOSHIFUJI Hideaki / , (Thu Dec 27, 9:39 pm)