Whamcloud - gitweb
LU-2607 mdd: preserve input arguments in mdd_create()
[fs/lustre-release.git] / lustre / mdd / mdd_dir.c
index 6170636..6ba30e3 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -878,7 +878,6 @@ static int mdd_changelog_ext_ns_store(const struct lu_env  *env,
        rec->cr.cr_namelen = tname->ln_namelen;
        memcpy(rec->cr.cr_name, tname->ln_name, tname->ln_namelen);
        if (sname) {
-               LASSERT(sfid != NULL);
                rec->cr.cr_name[tname->ln_namelen] = '\0';
                memcpy(rec->cr.cr_name + tname->ln_namelen + 1, sname->ln_name,
                        sname->ln_namelen);
@@ -1443,10 +1442,13 @@ int mdd_object_initialize(const struct lu_env *env, const struct lu_fid *pfid,
         * because below function doesn't consider umask).
         * I'd suggest set all object attributes in creation time, see above.
         */
+       LASSERT(attr->la_valid & LA_MODE);
        attr->la_valid &= ~LA_MODE;
        rc = mdd_attr_set_internal(env, child, attr, handle, 0);
-        if (rc != 0)
-                RETURN(rc);
+       /* arguments are supposed to stay the same */
+       attr->la_valid |= LA_MODE;
+       if (rc != 0)
+               RETURN(rc);
 
        if (S_ISDIR(attr->la_mode)) {
                 /* Add "." and ".." for newly created dir */