Whamcloud - gitweb
LU-2607 mdd: preserve input arguments in mdd_create()
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Thu, 17 Jan 2013 07:43:08 +0000 (11:43 +0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 23 Jan 2013 23:53:33 +0000 (18:53 -0500)
all input arguments are supposed to stay as is so that
the caller can re-use them again.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Ie2be78e702bfa9b7febafe7d106f09beccbf48d3
Reviewed-on: http://review.whamcloud.com/5048
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdd/mdd_dir.c

index decdb60..6ba30e3 100644 (file)
@@ -1442,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 */