From ddb5936ee49db7648b1b2c3febd764cddece5d4a Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 18 Jul 2007 21:13:12 +0000 Subject: [PATCH] Branch b1_6 i=nathan i=scjody b=13063 Description: lfsck built against 1.4.x cannot run against 1.6.0 lustre Details : the definition for OBD_IOC_GETNAME changed in 1.6.0. One of the few external users of this ioctl number is lfsck's call to llapi_lov_get_uuids() and this caused lfsck to fail at startup. Add the old ioctl number to the handler so both old and new lfsck can work. --- lustre/ChangeLog | 14 ++++++++++++-- lustre/include/lustre_lib.h | 2 ++ lustre/llite/dir.c | 1 + lustre/llite/file.c | 11 +++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index bc6c481..f883e7c 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -493,12 +493,22 @@ Details : a disk corruption can cause the mballoc code to assert on a ext3_error() instead of assertions. Severity : major +Frequency : only with mballoc3 code and deep extent trees Bugzilla : 12861 -Description: ldiskfs_ext_search_right: bad header in inode #3981353: unexpected - eh_depth +Description: ldiskfs_ext_search_right: bad header in inode: unexpected eh_depth Details : a wrong check of extent headers in ldiskfs_ext_search_right() can cause the filesystem to be remounted read-only. +Severity : normal +Frequency : rare +Bugzilla : 13063 +Description: lfsck built against 1.4.x cannot run against 1.6.0 lustre +Details : the definition for OBD_IOC_GETNAME changed in 1.6.0. One of the + few external users of this ioctl number is lfsck's call to + llapi_lov_get_uuids() and this caused lfsck to fail at startup. + Add the old ioctl number to the handler so both old and new + lfsck can work. + -------------------------------------------------------------------------------- 2007-05-03 Cluster File Systems, Inc. diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index 3e929d1..092b3a6 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -442,6 +442,8 @@ static inline void obd_ioctl_freedata(char *buf, int len) #define OBD_IOC_BRW_WRITE _IOWR('f', 126, OBD_IOC_DATA_TYPE) #define OBD_IOC_NAME2DEV _IOWR('f', 127, OBD_IOC_DATA_TYPE) #define OBD_IOC_UUID2DEV _IOWR('f', 130, OBD_IOC_DATA_TYPE) +/* OBD_IOC_GETNAME_OLD is for compatibility with 1.4.x */ +#define OBD_IOC_GETNAME_OLD _IOR ('f', 131, OBD_IOC_DATA_TYPE) #define OBD_IOC_GETNAME _IOWR('f', 131, OBD_IOC_DATA_TYPE) #define OBD_IOC_LOV_GET_CONFIG _IOWR('f', 132, OBD_IOC_DATA_TYPE) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 8862b5c..2666a04 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -906,6 +906,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, RETURN(rc); } #endif /* HAVE_QUOTA_SUPPORT */ + case OBD_IOC_GETNAME_OLD: case OBD_IOC_GETNAME: { struct obd_device *obd = class_exp2obd(sbi->ll_osc_exp); if (!obd) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 3c0779e..ef6b1f9 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -2132,6 +2132,17 @@ int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd, RETURN(ll_put_grouplock(inode, file, arg)); case IOC_OBD_STATFS: RETURN(ll_obd_statfs(inode, (void *)arg)); + case OBD_IOC_GETNAME_OLD: + case OBD_IOC_GETNAME: { + struct obd_device *obd = + class_exp2obd(ll_i2sbi(inode)->ll_osc_exp); + if (!obd) + RETURN(-EFAULT); + if (copy_to_user((void *)arg, obd->obd_name, + strlen(obd->obd_name) + 1)) + RETURN (-EFAULT); + RETURN(0); + } /* We need to special case any other ioctls we want to handle, * to send them to the MDS/OST as appropriate and to properly -- 1.8.3.1