lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Sep 2010 09:53:09 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Dave Chinner <david@...morbit.com>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/17] fs: inode per-cpu last_ino allocator

Le jeudi 30 septembre 2010 à 07:36 +0200, Eric Dumazet a écrit :
> Le mercredi 29 septembre 2010 à 21:53 -0700, Andrew Morton a écrit :

> > > +static unsigned int last_ino_get(void)
> > > +{
> > > +	static unsigned int last_ino;
> > > +
> > > +	return ++last_ino;
> > > +}
> > 
> > This is racy with CONFIG_PREEMPT on some architectures, I suspect.  I'd
> > suggest conversion to atomic_t with, of course, an explanatory comment ;)
> > 
> 

In fact this code was OK when I submitted my original patch back in
2008, since it replaced fs/inode.c

	inode->i_ino = ++last_ino;

And this was protected by a surrounding spinlock
(spin_lock(&inode_lock); at that time)

Even after Nick patches, preemption is still disabled (by two
spinlocks... spin_lock(&sb_inode_list_lock); /
spin_lock(&inode->i_lock);)

So patch 15/17 seems good to me, I re-sign it as-is ;)

Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>

If it happens preemption is re-enabled later (with future patches), we
might need to change last_ino_get() too.

Thanks !


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists