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]
Message-ID: <Pine.LNX.4.61.0609051259070.20457@yvahk01.tjqt.qr>
Date:	Tue, 5 Sep 2006 13:00:52 +0200 (MEST)
From:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
To:	Steven Whitehouse <swhiteho@...hat.com>
cc:	linux-kernel@...r.kernel.org,
	Russell Cattelan <cattelan@...hat.com>,
	David Teigland <teigland@...hat.com>,
	Ingo Molnar <mingo@...e.hu>, hch@...radead.org
Subject: Re: [PATCH 06/16] GFS2: dentry, export, super and vm operations


>> >> >+	if (IS_ERR(inode))
>> >> >+		return ERR_PTR(PTR_ERR(inode));
>> >> 
>> >> Just return inode.
>> >
>> >The function returns a dentry, so it would need to be casted and I
>> >thought that would look "more odd" than this construction.
>> 
>> Yes, it is very odd indeed that you return an inode as a dentry at all. How is
>> the caller supposed to know whether it was an inode or dentry that was actually
>> returned?
>> 
>
>This is dealing with the error case only. If the function being called
>returns an error (signaled by IS_ERR(inode) - hence an invalid pointer

Seems reasonable. Would you like to add a comment? (Possibly a little 
shorter than this good explanation, maybe

	/* In case of an error, @inode carries the error value, and we
	have to return that. */

>value) then we need to return that error to the calling routing. Since
>this function in question returns a dentry, we convert the invalid
>pointer value from the function returning an inode into an integer and
>then covert the integer into an invalid pointer value again, but this
>time its an invalid pointer to a dentry and hence the correct return
>type for this function.



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