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

2007-12-28 Thread Fabio Olive Leite
On Wed, Dec 26, 2007 at 11:58:56AM -0800, Ray Lee wrote: > > On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: > > - if (jiffies - ent->last_usage < timeout) > > + if (time_before(jiffies, ent->last_usage + timeout)) > > I don't think this is a safe chan

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

2007-12-28 Thread Julia Lawall
On Wed, 26 Dec 2007, H. Peter Anvin wrote: > Ray Lee wrote: > > On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: > > > - if (jiffies - ent->last_usage < timeout) > > > + if (time_before(jiffies, ent->last_usage + timeout)) > > > > I don't think this is

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

2007-12-27 Thread Ian Kent
On Thu, 2007-12-27 at 08:08 +0100, Julia Lawall wrote: > On Wed, 26 Dec 2007, H. Peter Anvin wrote: > > > Ray Lee wrote: > > > On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: > > > > - if (jiffies - ent->last_usage < timeout) > > > > + if (time_before(j

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

2007-12-27 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Thu, 27 Dec 2007 08:08:53 +0100 (CET)), Julia Lawall <[EMAIL PROTECTED]> says: > On Wed, 26 Dec 2007, H. Peter Anvin wrote: > > > Ray Lee wrote: > > > On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: > > > > - if (jiffies - ent->la

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

2007-12-26 Thread Julia Lawall
On Wed, 26 Dec 2007, H. Peter Anvin wrote: > Ray Lee wrote: > > On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: > > > - if (jiffies - ent->last_usage < timeout) > > > + if (time_before(jiffies, ent->last_usage + timeout)) > > > > I don't think this is

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

2007-12-26 Thread H. Peter Anvin
Ray Lee wrote: On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: - if (jiffies - ent->last_usage < timeout) + if (time_before(jiffies, ent->last_usage + timeout)) I don't think this is a safe change? subtraction is always safe (if you think about it a

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

2007-12-26 Thread Ray Lee
On Dec 26, 2007 7:21 AM, Julia Lawall <[EMAIL PROTECTED]> wrote: > - if (jiffies - ent->last_usage < timeout) > + if (time_before(jiffies, ent->last_usage + timeout)) I don't think this is a safe change? subtraction is always safe (if you think about it as 'distance'),

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

2007-12-26 Thread Julia Lawall
On Wed, 26 Dec 2007, H. Peter Anvin wrote: > Julia Lawall wrote: > > From: Julia Lawall <[EMAIL PROTECTED]> > > > > The functions time_before, time_before_eq, time_after, and time_after_eq > > are more robust for comparing jiffies against other values. > > > > More robust, how? You already alm

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

2007-12-26 Thread H. Peter Anvin
Julia Lawall wrote: From: Julia Lawall <[EMAIL PROTECTED]> The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. More robust, how? You already almost introduced a bug here... -hpa -- To unsubscribe from t

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

2007-12-26 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. A simplified version of the semantic patch making this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @ ch