Re: Re: [PATCH] dm: fix freeze_bdev() return value check

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

 



Akinobu Mita wrote:
> 2007/9/24, Akinobu Mita <akinobu.mita@xxxxxxxxx>:
>> freeze_bdev() does not return errno as pointer on failure.
>> This patch fixes the return value check.
> 
...
> But there is no reason to check the return value with IS_ERR().
> Because freeze_bdev return NULL or valid super block

Yes, but there is another place in kernel using this check
(see /fs/xfs/xfs_fsops.c)

Probably question for Christoph Hellwig - some changes related to
returning error in frezze_bdev() were planned but never commited.
(see list archive)

Otherwise test for IS_ERR() should be removed.

Milan
--
mbroz@xxxxxxxxxx

> 
> Subject: [PATCH] dm: remove freeze_bdev() return value check
> From: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> 
> There is no reason to check the return value with IS_ERR().
> Because freeze_bdev return NULL or valid super block.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> 
> ---
>  drivers/md/dm.c |    7 -------
>  1 file changed, 7 deletions(-)
> 
> Index: 2.6-git/drivers/md/dm.c
> ===================================================================
> --- 2.6-git.orig/drivers/md/dm.c
> +++ 2.6-git/drivers/md/dm.c
> @@ -1290,16 +1290,9 @@ out:
>   */
>  static int lock_fs(struct mapped_device *md)
>  {
> -	int r;
> -
>  	WARN_ON(md->frozen_sb);
> 
>  	md->frozen_sb = freeze_bdev(md->suspended_bdev);
> -	if (IS_ERR(md->frozen_sb)) {
> -		r = PTR_ERR(md->frozen_sb);
> -		md->frozen_sb = NULL;
> -		return r;
> -	}
> 
>  	set_bit(DMF_FROZEN, &md->flags);
> 

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux