[Ocfs2-tools-devel] [PATCH] return err when ocfs2_get_device_sectsize() can not determine sector size, v2

Joel Becker Joel.Becker at oracle.com
Wed Mar 11 17:51:59 PDT 2009


On Tue, Mar 10, 2009 at 11:58:06PM +0800, Coly Li wrote:
> This patch is modified from "[PATCH] libocfs2: check sectsize after return from
> ocfs2_get_device_sectsize()" with Joel's suggestion.
> 
> 
> In ocfs2_get_device_sectsize(), if BLKSSZGET is undefined, *sectsize is set to
> 0. This is problematic in ocfs2_fill_heartbeat_desc() where sectsize_bits =
> ffs(sectsize) - 1; will gets sectsize_bits to be ~0. Though the execution flow
> is safe, the logic is not correct.
> 
> This patch adds a new error code OCFS2_ET_CANNOT_DETERMINE_SECTOR_SIZE, when
> ocfs2_get_device_sectsize() can not determine sector size, just returns this
> error code.
> 
> Signed-off-by: Coly Li <coly.li at suse.de>

	Works for me.  I'm pulling this into a fixes branch I'm going to
push up as soon as I collect the various tools things.

Joel

-- 

Life's Little Instruction Book #69

	"Whistle"

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list