From: Liang Zhen Date: Mon, 4 Apr 2011 13:46:23 +0000 (+0800) Subject: LU-190 opencreate without mode can crash llite X-Git-Tag: 2.0.60.0~30 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8e04352101ce30d4b32dc218a8f2ab6396101e98 LU-190 opencreate without mode can crash llite user should specify mode for opencreate but if they don't llite will LBUG, which is not good. Change-Id: I614e655a8bef8ea9d62161591c99d305ce760732 Signed-off-by: Liang Zhen Reviewed-on: http://review.whamcloud.com/395 Tested-by: Hudson Reviewed-by: Oleg Drokin Reviewed-by: Johann Lombardi --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 1f39a7a..f9f9bc7 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -610,7 +610,7 @@ struct lookup_intent *ll_convert_intent(struct open_intent *oit, it->it_op = IT_OPEN; if (lookup_flags & LOOKUP_CREATE) it->it_op |= IT_CREAT; - it->it_create_mode = oit->create_mode; + it->it_create_mode = (oit->create_mode & S_IALLUGO) | S_IFREG; it->it_flags = oit->flags; } else { it->it_op = IT_GETATTR;