Whamcloud - gitweb
LU-3643 ofd: get data version only if file exists 24/7124/3
authorJinshan Xiong <jinshan.xiong@intel.com>
Fri, 26 Jul 2013 00:48:22 +0000 (17:48 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 29 Jul 2013 16:19:08 +0000 (16:19 +0000)
commitb36de486200154ca82194e2159ff0f96c41c7069
treec0d96b94e49fcb8af6d2fdc60a570421b9c20b61
parenta92f872952317591da7540fabe98a262298aa428
LU-3643 ofd: get data version only if file exists

In ofd_getattr(), dt_version_get() could be called on a non-existant
object, leading to a NULL pointer for its inode.
It should try to call dt_version_get() only if attr_get returns
success; otherwise it will crash.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Change-Id: I450fb78b85ea86d813ccad4de2f14f5bd4fca645
Reviewed-on: http://review.whamcloud.com/7124
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ofd/ofd_obd.c