Hi All,

I would like to request a code review for:

6224897 NFSV4 server and PCFS filesystem don't like to discuss
_PC_FILESIZEBITS

The CR is at:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6224897

The webrev is at:
http://cr.opensolaris.org/~pshivam/6224897_PC_FILESIZEBITS/


Background:

The NFSv4 server wants to determine the maximum file size of the
underlying file system, e.g., at the client mount time. The server uses
VOP_PATHCONF(_PC_FILESIZEBITS) call to do so. The current server
implementation does not handle the case where the underlying file system
does not support _PC_FILESIZEBITS pathconf query.

The problem was first reported against PCFS. However, the problem no
longer occurs with PCFS, since it supports _PC_FILESIZEBITS since
snv_15. Nevertheless, NFSv4 needs to be more robust to the missing
support for maximum file size from the underlying file system, and
return a reasonable default.

The current implementation seems to be doing the right thing
accidentally (as far as I can tell). In the following check, the value
of the variable val is -1 when the _PC_FILESIZEBITS is not supported by
the underlying file system. However, since val is an unsigned long, the
"if" condition evaluates to true, and UINT64_MAX is the default value
for maxfilesize.

1573                 error = VOP_PATHCONF(sarg->cs->vp,
_PC_FILESIZEBITS, &val,
1574                     sarg->cs->cr, NULL);
1575                 if (error)
1576                         break;
1577                 if (val >= (sizeof (uint64_t) * 8))
1578                         na->maxfilesize = UINT64_MAX;
1579                 else
1580                         na->maxfilesize = ((1LL << val) - 1);


Thanks,
Piyush



Reply via email to