ceph:Fix error handling in the function ceph_readddir_prepopulate
Quoted 24 lines · Nicholas Krause
This fixes error handling in the function
ceph_readddir_prepopulateto properly check if the call to the functionceph_fill_dirfraghas failed by returning a error code. Further more if this does arise jump to the goto label, out of the functionceph_readdir_prepopulatein order to clean up previously allocated resources by this function before returning to the caller this errror code in order for all callers to be now aware and able to handle this failure in their own intended error paths.Signed-off-by Nicholas Krause <[email protected]>---
fs/ceph/inode.c| 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)fs/ceph/inode.c +0
-0@@ -1417,8 +1417,11 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, }else { dout("readdir_prepopulate %d items under dn %p\n",
fs/ceph/inode.c int ceph_readdir_prepopulate(struct ceph_mds_request *req, · line 1426
Quoted 10 lines
fs/ceph/inode.c +5
-2rinfo->dir_nr, parent); -if (rinfo->dir_dir) -ceph_fill_dirfrag (d_inode (parent), rinfo->dir_dir); +if (rinfo->dir_dir) { + err =ceph_fill_dirfrag (d_inode (parent), rinfo->dir_dir); +if (err) + goto out; + } }
ceph_fill_dirfrag() failure is not fatal. I think it’s better to not skip later code when it happens.
Regards
Yan, Zheng
Quoted 4 lines
fs/ceph/inode.c +0
-0if (ceph_frag_is_leftmost (frag) && req->r_readdir_offset ==2 ) {Signature · 1 line
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html