Re: [PATCH v7 12/26] pnfsblock: add device operations

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

 



On Tue, Sep 13, 2011 at 11:14 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> On Sat, 30 Jul 2011 20:52:42 -0400
> Jim Rees <rees@xxxxxxxxx> wrote:
>
>> Signed-off-by: Jim Rees <rees@xxxxxxxxx>
>> Signed-off-by: Fred Isaman <iisaman@xxxxxxxxxxxxxx>
>> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
>> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxx>
>> [upcall bugfixes]
>> Signed-off-by: Peng Tao <peng_tao@xxxxxxx>
>> ---
>>  fs/nfs/blocklayout/Makefile         |    2 +-
>>  fs/nfs/blocklayout/blocklayout.c    |   42 ++++++++
>>  fs/nfs/blocklayout/blocklayout.h    |   40 +++++++
>>  fs/nfs/blocklayout/blocklayoutdev.c |  191 +++++++++++++++++++++++++++++++++++
>>  fs/nfs/client.c                     |    2 +-
>>  include/linux/nfs.h                 |    2 +
>>  6 files changed, 277 insertions(+), 2 deletions(-)
>>  create mode 100644 fs/nfs/blocklayout/blocklayoutdev.c
>>
>
> [...]
>> +static const struct rpc_pipe_ops bl_upcall_ops = {
>> +     .upcall         = bl_pipe_upcall,
>> +     .downcall       = bl_pipe_downcall,
>> +     .destroy_msg    = bl_pipe_destroy_msg,
>> +};
>> +
>>  static int __init nfs4blocklayout_init(void)
>>  {
>> +     struct vfsmount *mnt;
>> +     struct path path;
>>       int ret;
>>
>>       dprintk("%s: NFSv4 Block Layout Driver Registering...\n", __func__);
>>
>>       ret = pnfs_register_layoutdriver(&blocklayout_type);
>> +     if (ret)
>> +             goto out;
>> +
>> +     init_waitqueue_head(&bl_wq);
>> +
>> +     mnt = rpc_get_mount();
>> +     if (IS_ERR(mnt)) {
>> +             ret = PTR_ERR(mnt);
>> +             goto out_remove;
>> +     }
>> +
>
>
> Hmm...sorry for the late review on this, but I was just looking over
> this code as an example for some other stuff I'm working on...
>
> I notice that the above code does a rpc_get_mount to get a reference to
> the rpc_pipefs mount, but I don't see where that reference is ever put.
Thanks a lot for catching this.
Looking closer, we also missed a path_put() after vfs_path_lookup(). I
will send a patch fixing this.

Cheers,
Tao
>
>> +     ret = vfs_path_lookup(mnt->mnt_root,
>> +                           mnt,
>> +                           NFS_PIPE_DIRNAME, 0, &path);
>> +     if (ret)
>> +             goto out_remove;
>> +
>> +     bl_device_pipe = rpc_mkpipe(path.dentry, "blocklayout", NULL,
>> +                                 &bl_upcall_ops, 0);
>
>> +     if (IS_ERR(bl_device_pipe)) {
>> +             ret = PTR_ERR(bl_device_pipe);
>> +             goto out_remove;
>> +     }
>> +out:
>> +     return ret;
>> +
>> +out_remove:
>> +     pnfs_unregister_layoutdriver(&blocklayout_type);
>>       return ret;
>>  }
>>
>
>
>
> --
> Jeff Layton <jlayton@xxxxxxxxxx>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux