Whamcloud - gitweb
LU-6142 obdclass: Fix style issues for lu_ref.c
[fs/lustre-release.git] / lustre / obdclass / obdo.c
index 322b2f5..2321a83 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -184,6 +184,11 @@ void lustre_set_wire_obdo(const struct obd_connect_data *ocd,
        if (ocd == NULL)
                return;
 
+       if (!(wobdo->o_valid & OBD_MD_FLUID))
+               wobdo->o_uid = from_kuid(&init_user_ns, current_uid());
+       if (!(wobdo->o_valid & OBD_MD_FLGID))
+               wobdo->o_gid = from_kgid(&init_user_ns, current_gid());
+
        if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
            fid_seq_is_echo(ostid_seq(&lobdo->o_oi))) {
                /* Currently OBD_FL_OSTID will only be used when 2.4 echo