From 4708c17a0ec6c0931aaad85cbdf1e498d63715fb Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 14 Sep 2005 20:46:52 +0000 Subject: [PATCH] Branch b1_4 Move ChangeLog comment to end of 1.4.6 release notes. Fix CFS_PAGE_MASK for extent start in ost_get_extent_lock(). Add LDLM_FL_CBPENDING for all granted liblustre extent locks. Add OBD_CONNECT_SRVLOCK for OST only. Add misc comments from final patch. b=7311 r=nikita (original patch) --- lustre/ChangeLog | 35 ++++++++++++++++------------------- lustre/include/linux/lustre_idl.h | 7 +++++-- lustre/include/linux/lustre_lib.h | 6 ++++++ lustre/include/linux/obd.h | 6 +++++- lustre/ldlm/ldlm_lib.c | 1 + lustre/ldlm/ldlm_request.c | 6 +++++- lustre/ost/ost_handler.c | 7 ++++--- 7 files changed, 42 insertions(+), 26 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 6355825..0f88382 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -2,19 +2,6 @@ tbd Cluster File Systems, Inc. * version 1.4.6 * bug fixes -Severity : minor -Frequency : liblustre-only, when liblustre client dies unexpectedly or becomes - busy -Bugzilla : 7311 -Description: Avoid taking extent locks on the liblustre client while doing read - or write. -Details : Liblustre client cannot handle ASTs in timely manner, so this - patch tries to avoid granting such locks to it in the first place. - Locks are taken by OST. This is version that was - tested by the customer (Cray), newer version including - compatibility server flags and fixes to glimpse handling is - pending customer testing. - Severity : major Frequency : rare Bugzilla : 7407 @@ -83,7 +70,7 @@ Severity : minor Frequency : rare (only HPUX clients mounting unsupported re-exported NFS vol) Bugzilla : 5781 Description: an HPUX NFS client would get -EACCESS when ftruncate()ing a newly - created file with mode 000 + created file with mode 000 Details : the Linux NFS server relies on an MDS_OPEN_OWNEROVERRIDE hack to allow an ftruncate() as a non-root user to a file with mode 000. Lustre now respects this flag to disable mode checks when @@ -91,14 +78,24 @@ Details : the Linux NFS server relies on an MDS_OPEN_OWNEROVERRIDE hack to Severity : minor Frequency : liblustre-only, when liblustre client dies unexpectedly or becomes - busy + busy Bugzilla : 7313 Description: Revoking locks from clients that went dead or catatonic might take - a lot of time. + a lot of time. Details : New lock flags FL_CANCEL_ON_BLOCK used by liblustre makes - cancellation of such locks instant on servers without waiting for - any reply from clients. Clients drops these locks when cancel - notification from server is received without replying. + cancellation of such locks instant on servers without waiting for + any reply from clients. Clients drops these locks when cancel + notification from server is received without replying. + +Severity : minor +Frequency : liblustre-only, when liblustre client dies or becomes busy +Bugzilla : 7311 +Description: Doing ls on Linux clients can take a long time with active + liblustre clients +Details : Liblustre client cannot handle ASTs in timely manner, so avoid + granting such locks to it in the first place if possible. Locks + are taken by proxy on the OST during the read or write and + dropped immediately afterward. ------------------------------------------------------------------------------ diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 3d22103..b6fc6c5 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -45,6 +45,8 @@ #else #ifdef __CYGWIN__ # include +#elif defined(_AIX) +# include #else # include #endif @@ -205,10 +207,11 @@ static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags) /* Connect flags */ -#define OBD_CONNECT_RDONLY 0x1 +#define OBD_CONNECT_RDONLY 0x1ULL +#define OBD_CONNECT_SRVLOCK 0x10ULL /* server takes locks for client */ #define MDS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY) -#define OST_CONNECT_SUPPORTED (0) +#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK) #define ECHO_CONNECT_SUPPORTED (0) /* This structure is used for both request and reply. diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h index a05285b..4519f97 100644 --- a/lustre/include/linux/lustre_lib.h +++ b/lustre/include/linux/lustre_lib.h @@ -719,5 +719,11 @@ do { \ _ret__; \ }) +#ifdef __KERNEL__ +#define LIBLUSTRE_CLIENT (0) +#else +#define LIBLUSTRE_CLIENT (1) +#endif + #endif /* _LUSTRE_LIB_H */ diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index f2ec878..2afa6b9 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -619,8 +619,12 @@ struct obd_ops { int (*o_add_conn)(struct obd_import *imp, struct obd_uuid *uuid, int priority); int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid); + /* connect to the target device with given connection + * data. @ocd->ocd_connect_flags is modified to reflect flags actually + * granted by the target, which are guaranteed to be a subset of flags + * asked for. If @ocd == NULL, use default parameters. */ int (*o_connect)(struct lustre_handle *conn, struct obd_device *src, - struct obd_uuid *cluuid, struct obd_connect_data *); + struct obd_uuid *cluuid, struct obd_connect_data *ocd); int (*o_disconnect)(struct obd_export *exp); int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs, diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index a5b26bc..d7758ad 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -378,6 +378,7 @@ int client_obd_cleanup(struct obd_device *obddev) RETURN(0); } +/* ->o_connect() method for client side (OSC and MDC) */ int client_connect_import(struct lustre_handle *dlm_handle, struct obd_device *obd, struct obd_uuid *cluuid, struct obd_connect_data *data) diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 8e7cd4e..5eb65a4 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -401,7 +401,11 @@ int ldlm_cli_enqueue(struct obd_export *exp, LDLM_DEBUG(lock,"client-side enqueue, new policy data"); } - if ((*flags) & LDLM_FL_AST_SENT) { + if ((*flags) & LDLM_FL_AST_SENT || + /* Cancel extent locks as soon as possible on a liblustre client, + * because it cannot handle asynchronous ASTs robustly (see + * bug 7311). */ + (LIBLUSTRE_CLIENT && type == LDLM_EXTENT)) { l_lock(&ns->ns_lock); lock->l_flags |= LDLM_FL_CBPENDING; l_unlock(&ns->ns_lock); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index ff2d3f9..4b308e8 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -457,7 +457,8 @@ static int ost_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, RETURN(0); } -static int ost_glimpse_callback(struct ldlm_lock *lock, void *reqp) +/* ->l_glimpse_ast() for DLM extent locks acquired on the server-side. */ +static int ost_glimpse_ast(struct ldlm_lock *lock, void *reqp) { return -ELDLM_NO_LOCK_DATA; } @@ -485,14 +486,14 @@ static int ost_brw_lock_get(int mode, struct obd_export *exp, if (nrbufs == 0 || !(nb[0].flags & OBD_BRW_SRVLOCK)) RETURN(0); - policy.l_extent.start = nb[0].offset & ~CFS_PAGE_MASK; + policy.l_extent.start = nb[0].offset & CFS_PAGE_MASK; policy.l_extent.end = (nb[nrbufs - 1].offset + nb[nrbufs - 1].len - 1) | ~CFS_PAGE_MASK; RETURN(ldlm_cli_enqueue(NULL, NULL, exp->exp_obd->obd_namespace, res_id, LDLM_EXTENT, &policy, mode, &flags, ost_blocking_ast, ldlm_completion_ast, - ost_glimpse_callback, NULL, NULL, 0, NULL, lh)); + ost_glimpse_ast, NULL, NULL, 0, NULL, lh)); } static void ost_brw_lock_put(int mode, -- 1.8.3.1