[PATCH] jfs: 0 is not valid errno value - Kernel

This is a discussion on [PATCH] jfs: 0 is not valid errno value - Kernel ; .... so return NULL from jfs_lookup Signed-off-by: Marcin Slusarz Cc: Dave Kleikamp Cc: jfs-discussion@lists.sourceforge.net Cc: Alexander Viro --- is it ok to return NULL from this function? compile tested only --- fs/jfs/namei.c | 2 +- 1 files changed, 1 insertions(+), ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] jfs: 0 is not valid errno value

  1. [PATCH] jfs: 0 is not valid errno value

    .... so return NULL from jfs_lookup

    Signed-off-by: Marcin Slusarz
    Cc: Dave Kleikamp
    Cc: jfs-discussion@lists.sourceforge.net
    Cc: Alexander Viro
    ---
    is it ok to return NULL from this function?
    compile tested only
    ---
    fs/jfs/namei.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
    --- a/fs/jfs/namei.c
    +++ b/fs/jfs/namei.c
    @@ -1455,7 +1455,7 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
    free_UCSname(&key);
    if (rc == -ENOENT) {
    d_add(dentry, NULL);
    - return ERR_PTR(0);
    + return NULL;
    } else if (rc) {
    jfs_err("jfs_lookup: dtSearch returned %d", rc);
    return ERR_PTR(rc);
    --
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH] jfs: 0 is not valid errno value

    On Sun, 2008-05-11 at 22:08 +0200, Marcin Slusarz wrote:
    > ... so return NULL from jfs_lookup
    >
    > Signed-off-by: Marcin Slusarz


    Signed-off-by: Dave Kleikamp

    > Cc: jfs-discussion@lists.sourceforge.net
    > Cc: Alexander Viro
    > ---
    > is it ok to return NULL from this function?
    > compile tested only


    Yeah. I'm not sure how ERR_PTR(0) got in there in the first place.
    It's been that way for quite a while.

    I'll add it to the jfs git tree.

    Thanks,
    Shaggy

    > ---
    > fs/jfs/namei.c | 2 +-
    > 1 files changed, 1 insertions(+), 1 deletions(-)
    >
    > diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
    > --- a/fs/jfs/namei.c
    > +++ b/fs/jfs/namei.c
    > @@ -1455,7 +1455,7 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
    > free_UCSname(&key);
    > if (rc == -ENOENT) {
    > d_add(dentry, NULL);
    > - return ERR_PTR(0);
    > + return NULL;
    > } else if (rc) {
    > jfs_err("jfs_lookup: dtSearch returned %d", rc);
    > return ERR_PTR(rc);

    --
    David Kleikamp
    IBM Linux Technology Center

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread