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] [day] [month] [year] [list]
Date:	Wed, 14 Nov 2012 14:30:52 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Nick Bowler <nbowler@...iptictech.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scatterlist: don't BUG when we can trivially return a
 proper error.

On Wed, 14 Nov 2012 17:15:44 -0500
Nick Bowler <nbowler@...iptictech.com> wrote:

> > Unfortunately there is no EKERNELSCREWEDUP,
> 
> Well, maybe we should add it! :P

Well.  Given how frequently it will be used, it would need to be a much
shorter identifier.  Perhaps "EEK".  Or just "E".

> > so we usually use EINVAL.
> 
> Fair enough.  I will prepare v2.  But perhaps EOPNOTSUPP would be a
> better fit?

I have queued a delta:

From: Andrew Morton <akpm@...ux-foundation.org>
Subject: scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error-fix

s/E2BIG/EINVAL/

Cc: Nick Bowler <nbowler@...iptictech.com>
Cc: Maxim Levitsky <maximlevitsky@...il.com>
Cc: Tejun Heo <tj@...nel.org>
Cc: Jens Axboe <axboe@...nel.dk>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 lib/scatterlist.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN lib/scatterlist.c~scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error-fix lib/scatterlist.c
--- a/lib/scatterlist.c~scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error-fix
+++ a/lib/scatterlist.c
@@ -249,7 +249,7 @@ int __sg_alloc_table(struct sg_table *ta
 
 #ifndef ARCH_HAS_SG_CHAIN
 	if (WARN_ON_ONCE(nents > max_ents))
-		return -E2BIG;
+		return -EINVAL;
 #endif
 
 	memset(table, 0, sizeof(*table));
_

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