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]
Message-ID: <546DF745.1070901@plexistor.com>
Date:	Thu, 20 Nov 2014 16:14:29 +0200
From:	Boaz Harrosh <boaz@...xistor.com>
To:	Tejun Heo <tj@...nel.org>, Boaz Harrosh <boaz@...xistor.com>
CC:	Jens Axboe <axboe@...nel.dk>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christoph Hellwig <hch@...radead.org>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH vfs 2/2] {block|char}_dev: remove inode->i_devices

On 11/20/2014 03:11 PM, Tejun Heo wrote:
> Hello, Boaz.
> 
<>
> W/ preloading, one way to do it is,
> 
> 	if (preload())
> 		handle -ENOMEM;
> 	lock;
> 	error = insert();
> 	if (error)
> 		handle error which can't be -ENOMEM;
> 	unlock;
> 	preload_end();
> 

I like this one, cause of the place I come from. Where
in a cluster you want the local fails as early as possible
before you start to commit remotely, and need to undo on
errors.

And I can see the real flow of things

> Another way is
> 
> 	preload();	// can't fail
> 	lock;
> 	error = insert();
> 	if (error)
> 		handle error;'
> 	unlock;
> 	preload_end();
> 
> Both ways have pros and cons.  The latter seems to lead to simpler
> code in general.  Not always, but the overall.
> 

I still like the over all simplicity of the above pattern to
this behind the seen complexity hidden away under the carpet.

But I guess that is just me. That is your call sir.

I do see your point though.

<>
> 
> And that's why the pattern usually leads to simpler code - it doesn't
> create a new failure point.
> 

Again a matter of taste. I like the extra ENOMEM failure point before
I started to commit to any state changes, lock grabbing and unrolling
in case of errors.

But I see your points as well. For what it is worth I have reviewed
your code and did not find any faults in it. It looks like sound
code.

Thanks
Boaz

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