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, 17 Jul 2008 11:01:40 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Mark Fasheh <mfasheh@...e.com>
cc:	linux-kernel@...r.kernel.org, ocfs2-devel@....oracle.com,
	Joel Becker <joel.becker@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [git patches] Ocfs2 and Configfs updates for 2.6.27



On Thu, 17 Jul 2008, Mark Fasheh wrote:
> 
> The only two things that could be described as features would be:
> 
> - Joel updated configfs's ->make_item() and ->make_group() callbacks to
>   return more descriptive error types. This update is responsible for the
>  changes to drivers/net/netconsole.c and fs/dlm/config.c as shown in the diffstat.


.. I really dislike how this was done.

This commit:

11c3b79218390a139f2d474ee1e983a672d5839a ("configfs: Allow ->make_item() 
and ->make_group() to return detailed errors.")

is just ugly. Returning one value by passing a pointer to a pointer, and 
the error value by returning an 'int' errno is _not_ how we do things in 
the kernel.

No, we use error pointers. 

IOW, you should have left the calling convention for "(*make_item)()" and 
"(*make_group)()" alone, but allowed people to just do

	return ERR_PTR(-ENOMEM);

etc for errors, and then in the caller you just check for IS_ERR().

That would have made the result much cleaner, and avoided that whole 
"return two different things" issue.

I pulled it, but I want to register my protest.

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