Whamcloud - gitweb
LU-1674 llite: opencreate without mode can crash llite
authorLiang Zhen <liang@whamcloud.com>
Thu, 26 Jul 2012 00:38:07 +0000 (08:38 +0800)
committerJohann Lombardi <johann@whamcloud.com>
Thu, 13 Sep 2012 08:37:06 +0000 (04:37 -0400)
User should specify mode for opencreate but if they don't llite will
LBUG, which is not good.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I5c4044da6dda2a902bc48f408f6aaf8d02dd82a4
Reviewed-on: http://review.whamcloud.com/3469
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/llite/namei.c

index 7f0c7e3..4552127 100644 (file)
@@ -678,7 +678,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;