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

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

 



On Tue, 13 Sep 2016 08:53:01 +0200 Michal Hocko <mhocko@xxxxxxxxxx> wrote:

> On Mon 12-09-16 15:18:23, Andrew Morton wrote:
> > On Mon, 12 Sep 2016 15:11:46 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> 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.

Well, this is the only place in the kernel where we attempt to set
anything other than EIO.  I do think it's better to be honest about
what's happening, right here at the callsite.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]