Whamcloud - gitweb
LU-169 lov: add generation number to LOV EA
authorJohann Lombardi <johann@whamcloud.com>
Thu, 15 Dec 2011 00:00:00 +0000 (01:00 +0100)
committerOleg Drokin <green@whamcloud.com>
Sun, 8 Jan 2012 02:55:08 +0000 (21:55 -0500)
commitf90abfdc961debae069804307dcbc883b50c137c
treed574188b34363ba82a547c0740247cfb938284ac
parent9f55850b884cac1c7bbde6d3b02764b712a2921f
LU-169 lov: add generation number to LOV EA

This patch shrinks lov_mds_md_v*::lmm_stripe_count to 16 bits and use
the remaining 16 bits to store a generation number for the layout.
This generation will be used in conjunction the layout lock to allow
clients to detect when the file layout has changed.
The layout generation starts at 0 and will be bumped each time the
file layout is altered.
For backward compatibility, the layout generation is set to 0 when the
layout is sent to a client that does not support
OBD_CONNECT_LAYOUTLOCK.

This patch also stores OBD_INCOMPAT_LMM_VER in the MDS last_rcvd file
to prevent older versions of Lustre that cannot deal with a 16-bit
lmm_stripe from mounting the filesystem and exporting layouts to older
clients without setting the layout to 0.  This flag will be set in the
last_rcvd file only once we start modifying file layouts, but at least
the current version should not be confused by a 16-bit stripe count
and a non-zero generation.

Signed-off-by: Jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Change-Id: Ic40083227057eba565287d1a10890875b8a96c13
Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1866
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
30 files changed:
lustre/cmm/cmm_object.c
lustre/include/lustre/liblustreapi.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h
lustre/include/lustre_disk.h
lustre/include/md_object.h
lustre/include/obd.h
lustre/include/obd_lov.h
lustre/lclient/lcommon_misc.c
lustre/lov/lov_ea.c
lustre/lov/lov_internal.h
lustre/lov/lov_pack.c
lustre/lov/lov_qos.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_lov.c
lustre/mdd/mdd_object.c
lustre/mds/mds_lov.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_open.c
lustre/mdt/mdt_reint.c
lustre/obdclass/debug.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/wiretest.c