Skip to content

Commit c16ff19

Browse files
shaoyingxumngyadam
authored andcommitted
lustre: update to AmazonFSxLustreClient v2.10.8-10
Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
1 parent ce4970f commit c16ff19

File tree

12 files changed

+296
-407
lines changed

12 files changed

+296
-407
lines changed

drivers/staging/lustrefsx/config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@
981981
#define LUSTRE_PATCH 8
982982

983983
/* A copy of PACKAGE_VERSION */
984-
#define LUSTRE_VERSION_STRING "2.10.8"
984+
#define LUSTRE_VERSION_STRING "2.10.8-10"
985985

986986
/* maximum number of MDS threads */
987987
/* #undef MDS_MAX_THREADS */
@@ -1014,7 +1014,7 @@
10141014
#define PACKAGE_NAME "Lustre"
10151015

10161016
/* Define to the full name and version of this package. */
1017-
#define PACKAGE_STRING "Lustre 2.10.8"
1017+
#define PACKAGE_STRING "Lustre 2.10.8-10"
10181018

10191019
/* Define to the one symbol short name of this package. */
10201020
#define PACKAGE_TARNAME "lustre"
@@ -1023,7 +1023,7 @@
10231023
#define PACKAGE_URL ""
10241024

10251025
/* Define to the version of this package. */
1026-
#define PACKAGE_VERSION "2.10.8"
1026+
#define PACKAGE_VERSION "2.10.8-10"
10271027

10281028
/* name of parallel fsck program */
10291029
#define PFSCK "fsck"
@@ -1067,7 +1067,7 @@
10671067
/* #undef USE_LU_REF */
10681068

10691069
/* Version number of package */
1070-
#define VERSION "2.10.8"
1070+
#define VERSION "2.10.8-10"
10711071

10721072
/* zfs fix version */
10731073
/* #undef ZFS_FIX */

drivers/staging/lustrefsx/libcfs/include/libcfs/linux/linux-time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static inline cfs_time_t cfs_time_current(void)
259259

260260
static inline time_t cfs_time_current_sec(void)
261261
{
262-
return get_seconds();
262+
return ktime_get_real_seconds();
263263
}
264264

265265
static inline cfs_duration_t cfs_time_seconds(int seconds)

drivers/staging/lustrefsx/lnet/klnds/o2iblnd/o2iblnd_cb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,8 +3375,8 @@ kiblnd_connd (void *arg)
33753375
}
33763376

33773377
while (reconn < KIB_RECONN_BREAK) {
3378-
if (kiblnd_data.kib_reconn_sec != get_seconds()) {
3379-
kiblnd_data.kib_reconn_sec = get_seconds();
3378+
if (kiblnd_data.kib_reconn_sec != ktime_get_real_seconds()) {
3379+
kiblnd_data.kib_reconn_sec = ktime_get_real_seconds();
33803380
list_splice_init(&kiblnd_data.kib_reconn_wait,
33813381
&kiblnd_data.kib_reconn_list);
33823382
}

drivers/staging/lustrefsx/lustre/include/obd_class.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,9 @@ int class_register_type(struct obd_ops *, struct md_ops *, bool enable_proc,
6565
const char *nm, struct lu_device_type *ldt);
6666
int class_unregister_type(const char *nm);
6767

68-
struct obd_device *class_newdev(const char *type_name, const char *name,
69-
const char *uuid);
70-
int class_register_device(struct obd_device *obd);
71-
void class_unregister_device(struct obd_device *obd);
72-
void class_free_dev(struct obd_device *obd);
68+
struct obd_device *class_newdev(const char *type_name, const char *name);
69+
void class_release_dev(struct obd_device *obd);
7370

74-
struct obd_device *class_dev_by_str(const char *str);
7571
int class_name2dev(const char *name);
7672
struct obd_device *class_name2obd(const char *name);
7773
int class_uuid2dev(struct obd_uuid *uuid);
@@ -319,8 +315,6 @@ struct obd_export *class_export_get(struct obd_export *exp);
319315
void class_export_put(struct obd_export *exp);
320316
struct obd_export *class_new_export(struct obd_device *obddev,
321317
struct obd_uuid *cluuid);
322-
struct obd_export *class_new_export_self(struct obd_device *obd,
323-
struct obd_uuid *uuid);
324318
void class_unlink_export(struct obd_export *exp);
325319

326320
struct obd_import *class_import_get(struct obd_import *);

drivers/staging/lustrefsx/lustre/ldlm/ldlm_lib.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ int target_handle_connect(struct ptlrpc_request *req)
950950
* reconnect case */
951951
struct lustre_handle conn;
952952
struct lustre_handle *tmp;
953+
struct obd_uuid tgtuuid;
953954
struct obd_uuid cluuid;
954955
char *str;
955956
int rc = 0;
@@ -958,6 +959,7 @@ int target_handle_connect(struct ptlrpc_request *req)
958959
bool mds_conn = false, lw_client = false, initial_conn = false;
959960
bool mds_mds_conn = false;
960961
bool new_mds_mds_conn = false;
962+
bool target_referenced = false;
961963
struct obd_connect_data *data, *tmpdata;
962964
int size, tmpsize;
963965
lnet_nid_t *client_nid = NULL;
@@ -971,7 +973,11 @@ int target_handle_connect(struct ptlrpc_request *req)
971973
GOTO(out, rc = -EINVAL);
972974
}
973975

974-
target = class_dev_by_str(str);
976+
obd_str2uuid(&tgtuuid, str);
977+
target = class_uuid2obd(&tgtuuid);
978+
if (!target)
979+
target = class_name2obd(str);
980+
975981
if (!target) {
976982
deuuidify(str, NULL, &target_start, &target_len);
977983
LCONSOLE_ERROR_MSG(0x137, "%s: not available for connect "
@@ -983,9 +989,6 @@ int target_handle_connect(struct ptlrpc_request *req)
983989
}
984990

985991
spin_lock(&target->obd_dev_lock);
986-
987-
target->obd_conn_inprogress++;
988-
989992
if (target->obd_stopping || !target->obd_set_up) {
990993
spin_unlock(&target->obd_dev_lock);
991994

@@ -1007,6 +1010,13 @@ int target_handle_connect(struct ptlrpc_request *req)
10071010
GOTO(out, rc = -EAGAIN);
10081011
}
10091012

1013+
/* Make sure the target isn't cleaned up while we're here. Yes,
1014+
* there's still a race between the above check and our incref here.
1015+
* Really, class_uuid2obd should take the ref. */
1016+
class_incref(target, __func__, current);
1017+
target_referenced = true;
1018+
1019+
target->obd_conn_inprogress++;
10101020
spin_unlock(&target->obd_dev_lock);
10111021

10121022
str = req_capsule_client_get(&req->rq_pill, &RMF_CLUUID);
@@ -1433,11 +1443,12 @@ int target_handle_connect(struct ptlrpc_request *req)
14331443

14341444
class_export_put(export);
14351445
}
1436-
if (target != NULL) {
1446+
if (target_referenced == true && target != NULL) {
14371447
spin_lock(&target->obd_dev_lock);
14381448
target->obd_conn_inprogress--;
14391449
spin_unlock(&target->obd_dev_lock);
1440-
class_decref(target, "find", current);
1450+
1451+
class_decref(target, __func__, current);
14411452
}
14421453
req->rq_status = rc;
14431454
RETURN(rc);

drivers/staging/lustrefsx/lustre/llite/super25.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ static int __init lustre_init(void)
104104
struct lnet_process_id lnet_id;
105105
struct timespec64 ts;
106106
int i, rc, seed[2];
107+
unsigned long lustre_inode_cache_flags;
107108

108109
CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1);
109110

@@ -113,9 +114,15 @@ static int __init lustre_init(void)
113114
CDEBUG(D_INFO, "Lustre client module (%p).\n",
114115
&lustre_super_operations);
115116

117+
lustre_inode_cache_flags = SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT |
118+
SLAB_MEM_SPREAD;
119+
#ifdef SLAB_ACCOUNT
120+
lustre_inode_cache_flags |= SLAB_ACCOUNT;
121+
#endif
122+
116123
ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
117124
sizeof(struct ll_inode_info),
118-
0, SLAB_HWCACHE_ALIGN, NULL);
125+
0, lustre_inode_cache_flags, NULL);
119126
if (ll_inode_cachep == NULL)
120127
GOTO(out_cache, rc = -ENOMEM);
121128

drivers/staging/lustrefsx/lustre/llite/xattr_security.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ int ll_dentry_init_security(struct dentry *dentry, int mode, struct qstr *name,
7676

7777
rc = security_dentry_init_security(dentry, mode, name, secctx,
7878
secctx_size);
79-
if (rc == -EOPNOTSUPP)
79+
/* Usually, security_dentry_init_security() returns -EOPNOTSUPP when
80+
* SELinux is disabled.
81+
* But on some kernels (e.g. rhel 8.5) it returns 0 when SELinux is
82+
* disabled, and in this case the security context is empty.
83+
*/
84+
if (rc == -EOPNOTSUPP || (rc == 0 && *secctx_size == 0))
85+
/* do nothing */
8086
return 0;
8187
if (rc < 0)
8288
return rc;

0 commit comments

Comments
 (0)