Re: [PATCH 15/17] fs: inode per-cpu last_ino allocator

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

 



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@xxxxxxxxx>

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-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