]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: stat(2) fails during cthon04 basic test5 on NFSv4.0
authorChuck Lever <chuck.lever@oracle.com>
Wed, 6 May 2015 22:26:58 +0000 (18:26 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 13 May 2015 18:56:03 +0000 (14:56 -0400)
commita700f523d704f385169a8f962ea8b230f95ece59
treea7cd752f3ec84a8a10545071d409d92c080cb77e
parent97a9f3b5915f8567d8aedea4794ed1aa1c0b6485
nfs: stat(2) fails during cthon04 basic test5 on NFSv4.0

When running the Connectathon basic tests against a Solaris NFS
server over NFSv4.0, test5 reports that stat(2) returns a file size
of zero instead of 1MB.

On success, nfs_commit_inode() can return a positive result; see
other call sites such as nfs_file_fsync_commit() and
nfs_commit_unstable_pages().

The call site recently added in nfs_wb_all() does not prevent that
positive return value from leaking to its callers. If it leaks
through nfs_sync_inode() back to nfs_getattr(), that causes stat(2)
to return a positive return value to user space while also not
filling in the passed-in struct stat.

Additional clean up: the new logic in nfs_wb_all() is rewritten in
bfields-normal form.

Fixes: ab9f80492456 ("NFSv4.1/pnfs: Separate out metadata . . .")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/write.c