From: Trond Myklebust Date: Sat, 20 Nov 2010 18:24:49 +0000 (-0500) Subject: NFS: Fix the error handling in "uncached_readdir()" X-Git-Tag: firefly_0821_release~7613^2~3338^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=85f8607e163f8d281fb407357279cb4ac6df12e6;p=firefly-linux-kernel-4.4.55.git NFS: Fix the error handling in "uncached_readdir()" Currently, uncached_readdir() is broken because if fails to handle the results from nfs_readdir_xdr_to_array() correctly. Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 353f47c31b1d..2492bacf68a7 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -766,10 +766,9 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, desc->page_index = 0; desc->page = page; - if (nfs_readdir_xdr_to_array(desc, page, inode) == -1) { - status = -EIO; + status = nfs_readdir_xdr_to_array(desc, page, inode); + if (status < 0) goto out_release; - } status = nfs_do_filldir(desc, dirent, filldir);