Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1482180

Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded set_bit

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded set_bit
Date 2016-09-13 09:00 +0200
Message-ID <sgPRf-6Fc-11@gated-at.bofh.it> (permalink)
References <scwk9-7Sa-5@gated-at.bofh.it> <sgxrk-2vU-9@gated-at.bofh.it> <sgxrk-2vU-19@gated-at.bofh.it> <sgHK2-1cH-31@gated-at.bofh.it> <sgHK2-1cH-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon 12-09-16 15:18:23, Andrew Morton wrote:
> On Mon, 12 Sep 2016 15:11:46 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > > @@ -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.
> 
> hm, OK, it's not a functional change - the code was already doing
> s/ENXIO/EIO/.

Yes the rewrite is silent but I've decided to keep the current errno
because I have no idea whether this can change in future. It doesn't
sound probable but it also sounds safer to do an overwrite at a single
place rather than all over the place /me thinks.

> Let's make it look more truthful?
> 
> --- a/fs/afs/write.c~fs-use-mapping_set_error-instead-of-opencoded-set_bit-fix
> +++ a/fs/afs/write.c
> @@ -408,7 +408,7 @@ no_more:
>  		case -ENOMEDIUM:
>  		case -ENXIO:
>  			afs_kill_pages(wb->vnode, true, first, last);
> -			mapping_set_error(wb->vnode->vfs_inode.i_mapping, -ENXIO);
> +			mapping_set_error(wb->vnode->vfs_inode.i_mapping, -EIO);
>  			break;
>  		case -EACCES:
>  		case -EPERM:
> _
> 
> 

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] do not squash mapping flags and gfp_mask together (was: Re: [PATCH -v2] mm: Don't use radix tree writeback tags for pages in) Michal Hocko <mhocko@kernel.org> - 2016-09-12 13:20 +0200
  [PATCH 2/2] mm: split gfp_mask and mapping flags into separate fields Michal Hocko <mhocko@kernel.org> - 2016-09-12 13:20 +0200
    Re: [PATCH 2/2] mm: split gfp_mask and mapping flags into separate  fields Michal Hocko <mhocko@kernel.org> - 2016-09-12 13:50 +0200
  [PATCH 1/2] fs: use mapping_set_error instead of opencoded set_bit Michal Hocko <mhocko@kernel.org> - 2016-09-12 13:20 +0200
    Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded  set_bit Andrew Morton <akpm@linux-foundation.org> - 2016-09-13 00:20 +0200
      Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded  set_bit Andrew Morton <akpm@linux-foundation.org> - 2016-09-13 00:20 +0200
        Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded  set_bit Michal Hocko <mhocko@kernel.org> - 2016-09-13 09:00 +0200
          Re: [PATCH 1/2] fs: use mapping_set_error instead of opencoded  set_bit Andrew Morton <akpm@linux-foundation.org> - 2016-09-13 23:40 +0200

csiph-web