diff --git a/libproc/lustre.c b/libproc/lustre.c index 1bfe62c..697c64b 100644 --- a/libproc/lustre.c +++ b/libproc/lustre.c @@ -167,18 +167,33 @@ done: /* * Read the Lustre version from /proc and pack it into an int. * Returns the packed version or -1 on error. + * + * NOTE 2/1/18: for recent lustre releases lustre version is at /sys/fs/lustre/version + * and has simpler format (one line) + * # cat /sys/fs/lustre/version + * 2.10.2 + * + * HACK: + * + * ret<0 is not processed in calling functions + * and in many cases lustre version is interpreted as 1.8.x + * ALWAYS return some recent version as default (2.10.0 at this time). + * the alternative would be to cleanly fail */ + static int _packed_lustre_version (pctx_t ctx) { int ret = -1; int major = 0, minor = 0, patch = 0, fix = 0; - if ((ret = proc_fs_lustre_version (ctx, &major, &minor, &patch, &fix)) < 0) - goto done; - ret = PACKED_VERSION(major, minor, patch, fix); -done: + if ((ret = proc_fs_lustre_version (ctx, &major, &minor, &patch, &fix)) < 0) { + // goto done; + ret = PACKED_VERSION(2,10,0,0); + }else + ret = PACKED_VERSION(major, minor, patch, fix); +//done: return ret; }