Re: [parted] ped_partition_busy should not call the libparted exception handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this looks good to me.

If you want to go ahead and do a new parted build, its fine with me. :).

Regards.
On Tue, Oct 06, 2009 at 11:31:14AM +0200, Hans de Goede wrote:
> Modify libparted/arch/linux.c _partition_get_part_dev() to not call
> _device_stat() but instead use stat directly, as _device_stat() calls
> the libparted exception handler and we don't want this here, the only caller
> of _partition_get_part_dev() is _partition_is_mounted(), which in turn only
> gets called by linux_partition_is_busy(), and we don't want to "throw"
> exceptions from ped_partition_busy()
> 
> This issue was noticed in combination with pyparted as used by anaconda, see:
> https://bugzilla.redhat.com/show_bug.cgi?id=527035#c10
> ---
>  libparted/arch/linux.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index 52f7d21..a8d6daf 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -2127,7 +2127,7 @@ _partition_get_part_dev (const PedPartition* part)
>          struct stat dev_stat;
>          int dev_major, dev_minor;
>  
> -        if (!_device_stat (part->disk->dev, &dev_stat))
> +        if (stat (part->disk->dev->path, &dev_stat))
>                  return (dev_t)0;
>          dev_major = major (dev_stat.st_rdev);
>          dev_minor = minor (dev_stat.st_rdev);
> @@ -2184,6 +2184,8 @@ _partition_is_mounted (const PedPartition *part)
>          if (!ped_partition_is_active (part))
>                  return 0;
>          dev = _partition_get_part_dev (part);
> +        if (!dev)
> +        	return 0;
>          return _partition_is_mounted_by_dev (dev);
>  }
>  
> -- 
> 1.6.5.rc2
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.

Attachment: pgp0TQll7bvWP.pgp
Description: PGP signature

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux