Subject: Re: [PATCH v5 2/3] NFSD: convert write_version to netlink command

From: Lorenzo Bianconi <[email-masked]>
Date: Thu, 30 Nov 2023 11:32:17 +0100

> On Wed, 29 Nov 2023 18:12:44 +0100 Lorenzo Bianconi wrote:
> > +      -
> > +        name: status
> > +        type: u8
> 
> u8? I guess...

here we need just 0 or 1 I would say. Do you suggest create something like an
enum?

> > +/**
> > + * nfsd_nl_version_get_doit - Handle verion_get dumpit
> 
> doesn't match the function name (do -> dump)

ack, I will fix it.

> 
> > +			/* NFSv{2,3} does not support minor numbers */
> > +			if (i < 4 && j)
> > +				continue;
> > +
> > +			if (i == 4 && !nfsd_minorversion(nn, j, NFSD_TEST))
> > +				continue;
> > +
> > +			hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid,
> > +					  cb->nlh->nlmsg_seq, &nfsd_nl_family,
> > +					  0, NFSD_CMD_VERSION_GET);
> 
> Why not iput()?

ack, I will fix it.

Regards,
Lorenzo

> 
> > +			if (!hdr)
> > +				goto out;
> > +
> > +			if (nla_put_u32(skb, NFSD_A_SERVER_VERSION_MAJOR, i) ||
> > +			    nla_put_u32(skb, NFSD_A_SERVER_VERSION_MINOR, j))
> > +				goto out;
> > +
> > +			genlmsg_end(skb, hdr);
> > +		}
> > +	}
>