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

Re: [Minios-devel] [UNIKRAFT PATCH] lib/{ramfs, vfscore}: fix invalid error codes



Hi Sharan,

> Please find the comment inline:
> 
> [snip]
>
> > diff --git a/lib/ramfs/ramfs_vnops.c b/lib/ramfs/ramfs_vnops.c
> > index 6eca9b2..2ea2626 100644
> > --- a/lib/ramfs/ramfs_vnops.c
> > +++ b/lib/ramfs/ramfs_vnops.c
> > @@ -357,7 +357,7 @@ ramfs_truncate(struct vnode *vp, off_t length)
> >             new_size = round_pgup(length);
> >             new_buf = malloc(new_size);
> >             if (!new_buf)
> > -                   return EIO;
> > +                   return ENOMEM;
> truncate and ftruncate libc function which uses this function does not
> return ENOMEM. I presume the choice to EIO was based on this choice. So I
> would not change it.
> >             if (np->rn_size != 0) {
> >                     memcpy(new_buf, np->rn_buf, vp->v_size);
> >                     if (np->rn_owns_buf)
> > @@ -473,7 +473,7 @@ ramfs_write(struct vnode *vp, struct uio *uio, int 
> > ioflag)
> >                     void *new_buf = calloc(1, new_size);
> >                     if (!new_buf)
> > -                           return EIO;
> > +                           return ENOMEM;
> Same as above, the write function does not return ENOMEM.

thanks for the review, I have just sent an updated patch.

> >                     if (np->rn_size != 0) {
> >                             memcpy(new_buf, np->rn_buf, vp->v_size);
> >                             if (np->rn_owns_buf)
> > diff --git a/lib/vfscore/vnode.c b/lib/vfscore/vnode.c
> > index 6b5ea12..f3f1644 100644
> > --- a/lib/vfscore/vnode.c
> > +++ b/lib/vfscore/vnode.c
> > @@ -209,7 +209,7 @@ vfscore_vget(struct mount *mp, uint64_t ino, struct 
> > vnode **vpp)
> >     if ((error = VFS_VGET(mp, vp)) != 0) {
> >             VNODE_UNLOCK();
> >             free(vp);
> > -           return error;
> > +           return 0;
> >     }
> >     vfs_busy(vp->v_mount);
> >     uk_mutex_lock(&vp->v_lock);

cheers,
Hugo

-- 
                Hugo Lefeuvre (hle)    |    www.owl.eu.com
RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD
ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.