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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160912151146.9999e6b1a9b18eac61d177d2@linux-foundation.org>
Date:   Mon, 12 Sep 2016 15:11:46 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded
 set_bit

On Mon, 12 Sep 2016 13:16:07 +0200 Michal Hocko <mhocko@...nel.org> wrote:

> From: Michal Hocko <mhocko@...e.com>
> 
> mapping_set_error helper sets the correct AS_ flag for the mapping so
> there is no reason to open code it. Use the helper directly.
> 
> ...
>
> --- a/drivers/staging/lustre/lustre/llite/vvp_page.c
> +++ b/drivers/staging/lustre/lustre/llite/vvp_page.c
> @@ -247,10 +247,7 @@ static void vvp_vmpage_error(struct inode *inode, struct page *vmpage, int ioret
>  		obj->vob_discard_page_warned = 0;
>  	} else {
>  		SetPageError(vmpage);
> -		if (ioret == -ENOSPC)
> -			set_bit(AS_ENOSPC, &inode->i_mapping->flags);
> -		else
> -			set_bit(AS_EIO, &inode->i_mapping->flags);
> +		mapping_set_error(inode->i_mapping, ioret);
>  
>  		if ((ioret == -ESHUTDOWN || ioret == -EINTR) &&
>  		     obj->vob_discard_page_warned == 0) {
> diff --git a/fs/afs/write.c b/fs/afs/write.c
> index 14d506efd1aa..20ed04ab833c 100644
> --- a/fs/afs/write.c
> +++ b/fs/afs/write.c
> @@ -398,8 +398,7 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb,
>  		switch (ret) {
>  		case -EDQUOT:
>  		case -ENOSPC:
> -			set_bit(AS_ENOSPC,
> -				&wb->vnode->vfs_inode.i_mapping->flags);
> +			mapping_set_error(wb->vnode->vfs_inode.i_mapping, -ENOSPC);
>  			break;
>  		case -EROFS:
>  		case -EIO:
> @@ -409,7 +408,7 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb,
>  		case -ENOMEDIUM:
>  		case -ENXIO:
>  			afs_kill_pages(wb->vnode, true, first, last);
> -			set_bit(AS_EIO, &wb->vnode->vfs_inode.i_mapping->flags);
> +			mapping_set_error(wb->vnode->vfs_inode.i_mapping, -ENXIO);

This one is a functional change: mapping_set_error() will rewrite
-ENXIO into -EIO.  Doesn't seem at all important though.

> ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ