GNU bug report logs - #15356
[PATCH 00/19] Fedora parted patches

Previous Next

Package: parted;

Reported by: "Brian C. Lane" <bcl <at> redhat.com>

Date: Wed, 11 Sep 2013 20:18:03 UTC

Severity: normal

Tags: patch

Done: Phillip Susi <psusi <at> ubuntu.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Håkon Løvdal <hlovdal <at> gmail.com>
To: "Brian C. Lane" <bcl <at> redhat.com>
Cc: 15356 <at> debbugs.gnu.org
Subject: bug#15356: [PATCH 16/19] libparted: Recognize btrfs filesystem
Date: Sun, 24 Nov 2013 20:48:46 +0100
On 11 September 2013 21:25, Brian C. Lane <bcl <at> redhat.com> wrote:
> From: "Brian C. Lane" <bcl <at> redhat.com>
> +static PedGeometry*
> +btrfs_probe (PedGeometry* geom)
> +{
...
> +        if (geom->length < offset+1)
> +                return 0;
> +        if (!ped_geometry_read (geom, &buf, offset, 1))
> +                return 0;
Should not these be NULL rather than 0?

> +
> +        if (PED_LE64_TO_CPU(buf.sb.magic) == BTRFS_MAGIC) {
> +                return ped_geometry_new (geom->dev, geom->start, geom->length);
> +        }
> +        return NULL;
> +}

When already providing feedback on this code, I will also ask if this
test can be reversed,
so that the conceptual flow is

        if (some_error_condition) {
                handle_error
        }
        normal_code

e.g. "test exceptions, not the normal case"

BR Håkon Løvdal




This bug report was last modified 11 years and 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.