From: Sergey Cheremencev Date: Mon, 16 Nov 2015 12:54:25 +0000 (+0300) Subject: LU-7422 llite: don't panic when fid is insane X-Git-Tag: 2.8.54~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e4eb90ecdc09740d90834cb1e95b5693e6637173;hp=f5c7fec23cb26219d959290a4a311119747cc609 LU-7422 llite: don't panic when fid is insane LASSERT should never be done on data that is received to over the network. Return EINVAL when server returns invalid fid despite of it_status == 0. Change-Id: I4341d1002761ab4c86bd7af4d0ca5718fe2a3623 Signed-off-by: Sergey Cheremencev Seagate-bug-id: MRP-3073 Reviewed-on: http://review.whamcloud.com/17985 Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 578b171..cc1bab4 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -2303,11 +2303,16 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, } else { LASSERT(sb != NULL); - /* - * At this point server returns to client's same fid as client - * generated for creating. So using ->fid1 is okay here. - */ - LASSERT(fid_is_sane(&md.body->mbo_fid1)); + /* + * At this point server returns to client's same fid as client + * generated for creating. So using ->fid1 is okay here. + */ + if (!fid_is_sane(&md.body->mbo_fid1)) { + CERROR("%s: Fid is insane "DFID"\n", + ll_get_fsname(sb, NULL, 0), + PFID(&md.body->mbo_fid1)); + GOTO(out, rc = -EINVAL); + } *inode = ll_iget(sb, cl_fid_build_ino(&md.body->mbo_fid1, sbi->ll_flags & LL_SBI_32BIT_API),