Re: [PATCH] nbd: new nbd sysfs entries

From: Greg KH
Date: Wed Aug 03 2011 - 19:50:52 EST


On Wed, Aug 03, 2011 at 07:32:39PM -0400, Paul Clements wrote:
> Description: Add 3 new sysfs entries to nbd.
>
> # cat /sys/block/nbd6/nbd/peer
> 127.0.0.1
> # cat /sys/block/nbd6/nbd/flags
> 0
> # cat /sys/block/nbd6/nbd/xmit_timeout
> 6

Any new sysfs file (or removal or modification) also requires a matching
Documentation/ABI/ file as well. Please include it in this patch (if it
ends up surviving...)

> This patch depends on patch nbd-sysfs-framework.diff

I didn't like that one, it was wrong and I also think you caused a
reference count issue by adding a kobject to that structure...



> Description: Add 3 new sysfs entries to nbd.
>
> # cat /sys/block/nbd6/nbd/peer
> 127.0.0.1
> # cat /sys/block/nbd6/nbd/flags
> 0
> # cat /sys/block/nbd6/nbd/xmit_timeout
> 6
>
> This patch depends on patch nbd-sysfs-framework.diff
>
> From: Paul Clements <paul.clements@xxxxxxxxxxxx>
> Signed-off-by: Paul Clements <paul.clements@xxxxxxxxxxxx>
> ---
>
> nbd.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 77 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index 23f3619..44cd41d 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -136,7 +136,7 @@ static void sock_shutdown(struct nbd_device *lo, int lock)
> mutex_unlock(&lo->tx_lock);
> }
>
> -static void nbd_xmit_timeout(unsigned long arg)
> +static void xmit_timeout(unsigned long arg)

Why change the name of this function? You now have a function, field,
and sysfs file with that same name, talk about a way to cause confusion
when reading the code :(

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