Whamcloud - gitweb
LU-1206: mdt: Fix error handling in mdt_mfd_open
[fs/lustre-release.git] / lustre / obdclass / obdo.c
index 9da2405..390c234 100644 (file)
@@ -28,6 +28,8 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -85,7 +87,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, struct lu_fid *parent,
                 newvalid |= OBD_MD_FLCTIME;
         }
         if (valid & OBD_MD_FLSIZE) {
-                dst->o_size = src->i_size;
+                dst->o_size = i_size_read(src);
                 newvalid |= OBD_MD_FLSIZE;
         }
         if (valid & OBD_MD_FLBLOCKS) {  /* allocation of space (x512 bytes) */