NFSD: Stricter buffer size checking in write_versions()
authorChuck Lever <chuck.lever@oracle.com>
Thu, 23 Apr 2009 23:33:18 +0000 (19:33 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 28 Apr 2009 17:54:30 +0000 (13:54 -0400)
commit261758b5c3dfeac73ca364c47ed538f5ce4250ee
treeb5d8a8ec58eba1f400b3b5d4fbe222cdeda39d28
parent3d72ab8fdd44c872633b210dd1a4afd2910d0bbb
NFSD: Stricter buffer size checking in write_versions()

While it's not likely today that there are enough NFS versions to
overflow the output buffer in write_versions(), we should be more
careful about detecting the end of the buffer.

The number of NFS versions will only increase as NFSv4 minor versions
are added.

Note that this API doesn't behave the same as portlist.  Here we
attempt to display as many versions as will fit in the buffer, and do
not provide any indication that an overflow would have occurred.  I
don't have any good rationale for that.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfsctl.c