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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1250496884.20837.30.camel@wall-e>
Date:	Mon, 17 Aug 2009 10:14:44 +0200
From:	Stefani Seibold <stefani@...bold.net>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Arnd Bergmann <arnd@...db.de>,
	Andi Kleen <andi@...stfloor.org>,
	Amerigo Wang <xiyou.wangcong@...il.com>,
	Joe Perches <joe@...ches.com>
Subject: Re: [PATCH 2/7] kfifo: move out spinlock

Am Montag, den 17.08.2009, 09:08 +0100 schrieb Alan Cox:
> > > Those wrappers happen to be called kfifo_get and kfifo_put
> > 
> > Those names are wrong.
> 
> We've had them for years
> 
> > They're wrong because they are the spinlock-specific variant.  What are
> > we going to call the mutex_lock-specific variant?
> 
> There isn't one.
> 
> > 
> > > > But the happens-to-use-spin_lock functions shouldn't be called
> > > > kfifo_get(), because that steals namespace from the unlocked functions,
> > > > and makes the naming for the happens-to-use-mutex_lock functions look
> > > > weird.
> > > 
> > > All over the kernel unlocked function versions have a leading _ name.
> > > It's the kernel convention.
> > 
> > tisn't.  radix-tree, rbrtee, idr, list_head, prio_tree, flex_array -
> > none of them use that convention.
> 
> Some random "10 second grep" examples, and this is also used more
> generally for the "without extra goo" variant of things
> 
> __set_special_pids
> __sysrq_put_key_op
> __sysrq_get_key_op
> __handle_sysrq
> __audit_getname
> __audit_inode
> __audit_node_child
> 
> and the without extra goo use includes such minor classics
> __get_user
> __put_user
> 
> the kernel contains lots and lots of
> 
> __foo()
> 
> foo()
> {
> 	spin_lock(bar);
> 	__foo()
> 	spin_unlock(bar)
> }
> 
> > > The other thing I must say I dislike about these patches is the
> > > gratuitious 'let's rename all the functions' approach it takes. The kfifo
> > > API is documented, used and random API of the year type changes mess
> > > stuff up and cause unneeded churn.
> > 
> > It fixes naming mistakes.  Long-term it is the correct thing to do. 
> > Best to do it now before we get more callers.
> 
> Why don't we fix all the really dumb naming mistakes then - things like
> the chrdev interfaces ? Massive churn, massive confusion. Patches are
> always being rejected (and rightfully so) for causing such messes.
> 
> And remember: its very hard to fix existing API documentation and books.
> It's doubly dangerous (and IMHO a complete no-no) to change the API of an
> interface if you don't change it such that old code will not reliably get
> a compile time failure.
> 

As mention: i have no book which describes this interface.

To get reliably a compile time failure was the reason to change the
function names.

> Alan

Stefani


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ