staging/lustre: sync with external tree, set 2
cover staging/lustre: sync with external tree, set 2
Hi Greg,
Following 16 patches were ported from Lustre external tree. Please see if it is ok to apply them.
Thanks,
Tao
Amir Shehata (1):
staging/lustre/ptlrpc: Fix a crash when dereferencing NULL pointer
Andrew Perepechko (1):
staging/lustre/llite: extended attribute cache
Andriy Skulysh (1):
staging/lustre/ptlrpc: Fix race during exp_flock_hash creation
Dmitry Eremin (2):
staging/lustre/build: clean up unused variables and dead code staging/lustre/build: fix compilation issue with is_compat_task
Fan Yong (2):
staging/lustre/scrub: OI scrub on OST staging/lustre/scrub: control OI scrub on OST from user space
JC Lafoucriere (2):
staging/lustre/mdt: HSM coordinator client interface staging/lustre/mdt: HSM coordinator agent interface
Jinshan Xiong (1):
staging/lustre/hsm: Add hsm_release feature.
John L. Hammond (3):
staging/lustre/mdc: prevent fall through in mdc_iocontrol() staging/lustre/lu: shrink lu_object by 8 bytes on x86_64 staging/lustre/llite: don't check for O_CREAT in it_create_mode
Mikhail Pershin (2):
staging/lustre/server: use unified request handler for MGS staging/lustre/llog: MGC to use OSD API for backup logs
Patrick Farrell (1):
staging/lustre/nfs: writing to new files will return ENOENT
.../staging/lustre/include/linux/libcfs/libcfs.h | 2 - drivers/staging/lustre/lnet/selftest/rpc.c | 2 - drivers/staging/lustre/lnet/selftest/selftest.h | 3 - drivers/staging/lustre/lnet/selftest/timer.c | 6 +- drivers/staging/lustre/lustre/include/dt_object.h | 2 +- .../lustre/lustre/include/linux/lustre_compat25.h | 4 +- .../lustre/lustre/include/linux/lustre_lite.h | 1 + drivers/staging/lustre/lustre/include/lu_object.h | 19 - .../lustre/lustre/include/lustre/lustre_idl.h | 44 +- .../lustre/lustre/include/lustre/lustre_user.h | 24 +- drivers/staging/lustre/lustre/include/lustre_ha.h | 3 - drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/lustre_net.h | 2 - .../lustre/lustre/include/lustre_req_layout.h | 7 + drivers/staging/lustre/lustre/include/md_object.h | 4 +- drivers/staging/lustre/lustre/include/obd.h | 15 +- .../staging/lustre/lustre/include/obd_support.h | 10 + .../staging/lustre/lustre/lclient/lcommon_misc.c | 4 +- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 28 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 + drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 + drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 3 - drivers/staging/lustre/lustre/libcfs/workitem.c | 56 +- drivers/staging/lustre/lustre/llite/Makefile | 2 +- drivers/staging/lustre/lustre/llite/dcache.c | 36 +- drivers/staging/lustre/lustre/llite/dir.c | 24 +- drivers/staging/lustre/lustre/llite/file.c | 105 +++- .../staging/lustre/lustre/llite/llite_internal.h | 46 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 22 +- drivers/staging/lustre/lustre/llite/lproc_llite.c | 36 ++ drivers/staging/lustre/lustre/llite/namei.c | 15 +- drivers/staging/lustre/lustre/llite/super25.c | 4 + drivers/staging/lustre/lustre/llite/vvp_object.c | 2 +- drivers/staging/lustre/lustre/llite/xattr.c | 102 ++-- drivers/staging/lustre/lustre/llite/xattr_cache.c | 640 ++++++++++++++++++++ .../staging/lustre/lustre/lov/lov_cl_internal.h | 16 + drivers/staging/lustre/lustre/lov/lov_object.c | 35 +- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 1 + drivers/staging/lustre/lustre/mdc/mdc_lib.c | 26 +- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 63 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 54 +- drivers/staging/lustre/lustre/mgc/libmgc.c | 3 - drivers/staging/lustre/lustre/mgc/mgc_request.c | 401 +++++++----- drivers/staging/lustre/lustre/obdclass/llog.c | 212 ++++--- .../staging/lustre/lustre/obdclass/local_storage.c | 9 +- .../staging/lustre/lustre/obdclass/local_storage.h | 3 + .../lustre/lustre/obdclass/lprocfs_status.c | 4 - drivers/staging/lustre/lustre/obdclass/lu_object.c | 26 +- drivers/staging/lustre/lustre/obdclass/md_attrs.c | 4 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 3 + drivers/staging/lustre/lustre/ptlrpc/client.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/import.c | 2 - drivers/staging/lustre/lustre/ptlrpc/layout.c | 60 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 16 +- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 7 + drivers/staging/lustre/lustre/ptlrpc/pinger.c | 65 -- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 44 +- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 4 + 59 files changed, 1750 insertions(+), 618 deletions(-) create mode 100644 drivers/staging/lustre/lustre/llite/xattr_cache.c
Signature · 1 line
1.7.9.5
PATCH 1/16 staging/lustre/server: use unified request handler for MGS
From: Mikhail Pershin <[email protected]>
- Unify request handler. It finds target for particular request and calls appropriate handler for it. Generic handlers are moved to the unified target code. The tgt_session_info is introduced to store all request-related data and passed to all handlers.
- Pack reply in llog server functions early and use err_serious()
- remove obsoleted llog_origin_handle_cancel(), it is not used anymore
- remove push_ctxt/pop_ctxt from llog server function, it is based on OSD now.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2145
Lustre-change: http://review.whamcloud.com/4826
--- .../lustre/lustre/include/lustre_req_layout.h | 2 ++ .../staging/lustre/lustre/include/obd_support.h | 7 +++++++ drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 ++++++- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 4 ++-- 4 files changed, 17 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/include/lustre_req_layout.h +2 -0
@@ -245,6 +245,8 @@ extern struct req_format RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK;extern struct req_format RQF_LLOG_ORIGIN_HANDLE_READ_HEADER ;extern struct req_format RQF_LLOG_ORIGIN_CONNECT ; +extern struct req_format RQF_CONNECT ; +extern struct req_msg_field RMF_GENERIC_DATA ;extern struct req_msg_field RMF_PTLRPC_BODY ;extern struct req_msg_field RMF_MDT_BODY ;
drivers/staging/lustre/lustre/include/obd_support.h +7 -0
@@ -416,6 +416,13 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,#define OBD_FAIL_MGC_PAUSE_PROCESS_LOG 0x903#define OBD_FAIL_MGS_PAUSE_REQ 0x904#define OBD_FAIL_MGS_PAUSE_TARGET_REG 0x905 +#define OBD_FAIL_MGS_CONNECT_NET 0x906 +#define OBD_FAIL_MGS_DISCONNECT_NET 0x907 +#define OBD_FAIL_MGS_SET_INFO_NET 0x908 +#define OBD_FAIL_MGS_EXCEPTION_NET 0x909 +#define OBD_FAIL_MGS_TARGET_REG_NET 0x90a +#define OBD_FAIL_MGS_TARGET_DEL_NET 0x90b +#define OBD_FAIL_MGS_CONFIG_READ_NET 0x90c#define OBD_FAIL_QUOTA_DQACQ_NET 0xA01#define OBD_FAIL_QUOTA_EDQUOT 0xA02
drivers/staging/lustre/lustre/ptlrpc/layout.c +6 -1
@@ -738,7 +738,8 @@ static struct req_format *req_formats[] = { &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK , &RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK , &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER , - &RQF_LLOG_ORIGIN_CONNECT + &RQF_LLOG_ORIGIN_CONNECT , + &RQF_CONNECT, }; struct req_msg_field {
@@ -1504,6 +1505,10 @@ struct req_format RQF_LLOG_ORIGIN_CONNECT =DEFINE_REQ_FMT0 ("LLOG_ORIGIN_CONNECT" , llogd_conn_body_only, empty);EXPORT_SYMBOL (RQF_LLOG_ORIGIN_CONNECT ); +struct req_format RQF_CONNECT = +DEFINE_REQ_FMT0 ("CONNECT" , obd_connect_client, obd_connect_server); +EXPORT_SYMBOL (RQF_CONNECT ); +struct req_format RQF_OST_CONNECT =DEFINE_REQ_FMT0 ("OST_CONNECT" , obd_connect_client, obd_connect_server);
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +2 -2
@@ -114,10 +114,10 @@ struct ll_rpc_opcode { { MGS_SET_INFO, "mgs_set_info" }, { MGS_CONFIG_READ, "mgs_config_read" }, { OBD_PING, "obd_ping" }, - { OBD_LOG_CANCEL, "llog_origin_handle_cancel" }, + { OBD_LOG_CANCEL, "llog_cancel" }, { OBD_QC_CALLBACK, "obd_quota_callback" }, { OBD_IDX_READ, "dt_index_read" }, - { LLOG_ORIGIN_HANDLE_CREATE, "llog_origin_handle_create" }, + { LLOG_ORIGIN_HANDLE_CREATE, "llog_origin_handle_open" }, { LLOG_ORIGIN_HANDLE_NEXT_BLOCK, "llog_origin_handle_next_block" }, { LLOG_ORIGIN_HANDLE_READ_HEADER,"llog_origin_handle_read_header" }, { LLOG_ORIGIN_HANDLE_WRITE_REC, "llog_origin_handle_write_rec" },
Signature · 1 line
1.7.9.5
PATCH 2/16 staging/lustre/llog: MGC to use OSD API for backup logs
In reply to Peng TaoFrom: Mikhail Pershin <[email protected]>
MGC uses lvfs API to access local llogs blocking removal of old code
- MGS is converted to use OSD API for local llogs
- llog_is_empty() and llog_backup() are introduced
- initial OSD start initialize run ctxt so llog can use it too
- shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059
Lustre-change: http://review.whamcloud.com/5049
--- drivers/staging/lustre/lustre/include/dt_object.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/obd.h | 4 +- drivers/staging/lustre/lustre/mgc/libmgc.c | 3 - drivers/staging/lustre/lustre/mgc/mgc_request.c | 401 ++++++++++++-------- drivers/staging/lustre/lustre/obdclass/llog.c | 212 +++++++---- .../staging/lustre/lustre/obdclass/local_storage.c | 9 +- .../staging/lustre/lustre/obdclass/local_storage.h | 3 + drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 3 + 10 files changed, 408 insertions(+), 244 deletions(-)
drivers/staging/lustre/lustre/include/dt_object.h +1 -1
@@ -692,7 +692,7 @@ struct local_oid_storage {struct dt_object *los_obj;/* data used to generate new fids */ -struct mutex los_id_lock; +struct mutex los_id_lock;__u64 los_seq;__u32 los_last_oid; };
drivers/staging/lustre/lustre/include/lustre_log.h +12 -1
@@ -136,7 +136,11 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_handle **lgh, struct llog_logid *logid, char *name, enum llog_open_param open_param);int llog_close (const struct lu_env *env,struct llog_handle *cathandle); -int llog_get_size (struct llog_handle *loghandle); +int llog_is_empty (const struct lu_env *env,struct llog_ctxt *ctxt, +char *name); +int llog_backup (const struct lu_env *env,struct obd_device *obd, +struct llog_ctxt *ctxt,struct llog_ctxt *bak_ctxt, +char *name,char *backup);/* llog_process flags */ #define LLOG_FLAG_NODEAMON 0x0001
@@ -382,6 +386,13 @@ static inline int llog_data_len(int len)return cfs_size_round (len); } +static inline int llog_get_size (struct llog_handle *loghandle) +{ +if (loghandle && loghandle->lgh_hdr) +return loghandle->lgh_hdr->llh_count; +return 0 ; +} +static inline struct llog_ctxt *llog_ctxt_get (struct llog_ctxt *ctxt) {atomic_inc (&ctxt->loc_refcount);
drivers/staging/lustre/lustre/include/obd.h +2 -2
@@ -399,8 +399,8 @@ struct client_obd {/* mgc datastruct */ struct semaphore cl_mgc_sem; -struct vfsmount *cl_mgc_vfsmnt; -struct dentry *cl_mgc_configs_dir; +struct local_oid_storage *cl_mgc_los; +struct dt_object *cl_mgc_configs_dir;atomic_t cl_mgc_refcount;struct obd_export *cl_mgc_mgsexp;
drivers/staging/lustre/lustre/mgc/libmgc.c +0 -3
@@ -99,11 +99,8 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)static int mgc_cleanup (struct obd_device *obd) { -struct client_obd *cli = &obd->u.cli;int rc; -LASSERT (cli->cl_mgc_vfsmnt ==NULL ); -ptlrpcd_decref (); rc =client_obd_cleanup (obd);
drivers/staging/lustre/lustre/mgc/mgc_request.c +246 -155
527 lines not on this page · raw message
drivers/staging/lustre/lustre/obdclass/llog.c +134 -78
258 lines not on this page · raw message
drivers/staging/lustre/lustre/obdclass/local_storage.c +6 -3
@@ -855,9 +855,12 @@ out_los: (*los)->los_seq =fid_seq (first_fid); (*los)->los_last_oid =le64_to_cpu (lastid); (*los)->los_obj = o; -/* read value should not be less than initial one */ -LASSERTF ((*los)->los_last_oid >= first_oid,"%u < %u\n" , - (*los)->los_last_oid, first_oid); +/* Read value should not be less than initial one +* but possible after upgrade from older fs. +* In this case just switch to the first_oid in memory and +* it will be updated on disk with first object generated */ +if ((*los)->los_last_oid < first_oid) + (*los)->los_last_oid = first_oid; } out:mutex_unlock (&ls->ls_los_mutex);
drivers/staging/lustre/lustre/obdclass/local_storage.h +3 -0
@@ -29,6 +29,8 @@* * Author: Mikhail Pershin <[email protected]> */ +#ifndef __LOCAL_STORAGE_H +#define __LOCAL_STORAGE_H#include <dt_object.h> #include <obd.h>
@@ -86,3 +88,4 @@ struct los_ondisk { };#define LOS_MAGIC 0xdecafbee +#endif
drivers/staging/lustre/lustre/obdclass/lu_object.c +1 -1
@@ -423,7 +423,7 @@ LU_KEY_INIT_FINI(lu_global, struct lu_cdebug_data);*/ struct lu_context_key lu_global_key = { .lct_tags =LCT_MD_THREAD |LCT_DT_THREAD | -LCT_MG_THREAD |LCT_CL_THREAD , +LCT_MG_THREAD |LCT_CL_THREAD |LCT_LOCAL , .lct_init = lu_global_key_init, .lct_fini = lu_global_key_fini };
drivers/staging/lustre/lustre/obdclass/obd_mount.c +3 -0
@@ -631,6 +631,9 @@ int lustre_put_lsi(struct super_block *sb)CDEBUG (D_MOUNT ,"put %p %d\n" , sb,atomic_read (&lsi->lsi_mounts));if (atomic_dec_and_test (&lsi->lsi_mounts)) {if (IS_SERVER (lsi) && lsi->lsi_osd_exp) { +lu_device_put (&lsi->lsi_dt_dev->dd_lu_dev); + lsi->lsi_osd_exp->exp_obd->obd_lvfs_ctxt.dt =NULL ; + lsi->lsi_dt_dev =NULL ;obd_disconnect (lsi->lsi_osd_exp);/* wait till OSD is gone */ obd_zombie_barrier ();
Signature · 1 line
1.7.9.5
Greg Kroah-Hartman
maintainerRe: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
Quoted 9 lines · Peng Tao
From: Mikhail Pershin <[email protected]>
MGC uses lvfs API to access local llogs blocking removal of old code
- MGS is converted to use OSD API for local llogs
-llog_is_empty()andllog_backup()are introduced
- initial OSD start initialize run ctxt so llog can use it too
- shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount.
It is not checkpatch clean :(
Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time...
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · Peng Tao
From: Mikhail Pershin <[email protected]>
MGC uses lvfs API to access local llogs blocking removal of old code
- MGS is converted to use OSD API for local llogs
-llog_is_empty()andllog_backup()are introduced
- initial OSD start initialize run ctxt so llog can use it too
- shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount.
Quoted 5 lines
It is not checkpatch clean :(
Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time...
Strange. I did run checkpatch before sending the patchset out.
Just tried again. Still pass.
[X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total:
0 errors, 0 warnings, 883 lines checked
0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission.
What message did you see?
Thanks,
Tao
Greg Kroah-Hartman
maintainerRe: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
Quoted 23 lines · Peng Tao
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · Peng Tao
From: Mikhail Pershin <[email protected]>
MGC uses lvfs API to access local llogs blocking removal of old code
- MGS is converted to use OSD API for local llogs
-llog_is_empty()andllog_backup()are introduced
- initial OSD start initialize run ctxt so llog can use it too
- shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount.Quoted 5 lines
It is not checkpatch clean :(
Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time...
Strange. I did run checkpatch before sending the patchset out.
Just tried again. Still pass.
Quoted 8 lines
[X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total:
0 errors, 0 warnings, 883 lines checked0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission.
What message did you see?
One about return();
greg k-h
Peng Tao
Reviewed-by Lai Siyao Reviewed-by Alex Zhuravlev Reviewed-by James Simmons Reviewed-by Oleg DrokinRe: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
Quoted 28 lines · Greg Kroah-Hartman
Quoted 27 lines · Peng Tao
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · Peng Tao
From: Mikhail Pershin <[email protected]>
MGC uses lvfs API to access local llogs blocking removal of old code
- MGS is converted to use OSD API for local llogs
-llog_is_empty()andllog_backup()are introduced
- initial OSD start initialize run ctxt so llog can use it too
- shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount.Quoted 5 lines
It is not checkpatch clean :(
Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time...
Strange. I did run checkpatch before sending the patchset out.
Just tried again. Still pass.
[X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total:
0 errors, 0 warnings, 883 lines checked
Quoted 7 lines
Quoted 4 lines
0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission.
What message did you see?
One about
return();
OK. Looks like a latest checkpatch.pl change. After rebasing my working copy to latest staging-next, I can see the same error. I'll fix up. Sorry for the noise.
Thanks,
Tao
Quoted 1 line
From
93455fbe9b61a66218225c2ec4c14fc2a86bcf67Mon Sep 17 00:00:00 2001
From: Mikhail Pershin <[email protected]>
Date: Thu, 31 Oct 2013 17:06:29 +0800
Subject: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup
logs
MGC uses lvfs API to access local llogs blocking removal of old code
- MGS is converted to use OSD API for local llogs
- llog_is_empty() and llog_backup() are introduced
- initial OSD start initialize run ctxt so llog can use it too
- shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059
Lustre-change: http://review.whamcloud.com/5049
--- drivers/staging/lustre/lustre/include/dt_object.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/obd.h | 4 +- drivers/staging/lustre/lustre/mgc/libmgc.c | 3 - drivers/staging/lustre/lustre/mgc/mgc_request.c | 401 ++++++++++++-------- drivers/staging/lustre/lustre/obdclass/llog.c | 212 +++++++---- .../staging/lustre/lustre/obdclass/local_storage.c | 9 +- .../staging/lustre/lustre/obdclass/local_storage.h | 3 + drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 3 + 10 files changed, 408 insertions(+), 244 deletions(-)
drivers/staging/lustre/lustre/include/dt_object.h +1 -1
@@ -692,7 +692,7 @@ struct local_oid_storage {struct dt_object *los_obj;/* data used to generate new fids */ -struct mutex los_id_lock; +struct mutex los_id_lock;__u64 los_seq;__u32 los_last_oid; };
drivers/staging/lustre/lustre/include/lustre_log.h +12 -1
@@ -136,7 +136,11 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_handle **lgh, struct llog_logid *logid, char *name, enum llog_open_param open_param);int llog_close (const struct lu_env *env,struct llog_handle *cathandle); -int llog_get_size (struct llog_handle *loghandle); +int llog_is_empty (const struct lu_env *env,struct llog_ctxt *ctxt, +char *name); +int llog_backup (const struct lu_env *env,struct obd_device *obd, +struct llog_ctxt *ctxt,struct llog_ctxt *bak_ctxt, +char *name,char *backup);/* llog_process flags */ #define LLOG_FLAG_NODEAMON 0x0001
@@ -382,6 +386,13 @@ static inline int llog_data_len(int len)return cfs_size_round (len); } +static inline int llog_get_size (struct llog_handle *loghandle) +{ +if (loghandle && loghandle->lgh_hdr) +return loghandle->lgh_hdr->llh_count; +return 0 ; +} +static inline struct llog_ctxt *llog_ctxt_get (struct llog_ctxt *ctxt) {atomic_inc (&ctxt->loc_refcount);
drivers/staging/lustre/lustre/include/obd.h +2 -2
@@ -399,8 +399,8 @@ struct client_obd {/* mgc datastruct */ struct semaphore cl_mgc_sem; -struct vfsmount *cl_mgc_vfsmnt; -struct dentry *cl_mgc_configs_dir; +struct local_oid_storage *cl_mgc_los; +struct dt_object *cl_mgc_configs_dir;atomic_t cl_mgc_refcount;struct obd_export *cl_mgc_mgsexp;
drivers/staging/lustre/lustre/mgc/libmgc.c +0 -3
@@ -99,11 +99,8 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)static int mgc_cleanup (struct obd_device *obd) { -struct client_obd *cli = &obd->u.cli;int rc; -LASSERT (cli->cl_mgc_vfsmnt ==NULL ); -ptlrpcd_decref (); rc =client_obd_cleanup (obd);
drivers/staging/lustre/lustre/mgc/mgc_request.c +246 -155
527 lines not on this page · raw message
drivers/staging/lustre/lustre/obdclass/llog.c +134 -78
258 lines not on this page · raw message
drivers/staging/lustre/lustre/obdclass/local_storage.c +6 -3
@@ -855,9 +855,12 @@ out_los: (*los)->los_seq =fid_seq (first_fid); (*los)->los_last_oid =le64_to_cpu (lastid); (*los)->los_obj = o; -/* read value should not be less than initial one */ -LASSERTF ((*los)->los_last_oid >= first_oid,"%u < %u\n" , - (*los)->los_last_oid, first_oid); +/* Read value should not be less than initial one +* but possible after upgrade from older fs. +* In this case just switch to the first_oid in memory and +* it will be updated on disk with first object generated */ +if ((*los)->los_last_oid < first_oid) + (*los)->los_last_oid = first_oid; } out:mutex_unlock (&ls->ls_los_mutex);
drivers/staging/lustre/lustre/obdclass/local_storage.h +3 -0
@@ -29,6 +29,8 @@* * Author: Mikhail Pershin <[email protected]> */ +#ifndef __LOCAL_STORAGE_H +#define __LOCAL_STORAGE_H#include <dt_object.h> #include <obd.h>
@@ -86,3 +88,4 @@ struct los_ondisk { };#define LOS_MAGIC 0xdecafbee +#endif
drivers/staging/lustre/lustre/obdclass/lu_object.c +1 -1
@@ -423,7 +423,7 @@ LU_KEY_INIT_FINI(lu_global, struct lu_cdebug_data);*/ struct lu_context_key lu_global_key = { .lct_tags =LCT_MD_THREAD |LCT_DT_THREAD | -LCT_MG_THREAD |LCT_CL_THREAD , +LCT_MG_THREAD |LCT_CL_THREAD |LCT_LOCAL , .lct_init = lu_global_key_init, .lct_fini = lu_global_key_fini };
drivers/staging/lustre/lustre/obdclass/obd_mount.c +3 -0
@@ -631,6 +631,9 @@ int lustre_put_lsi(struct super_block *sb)CDEBUG (D_MOUNT ,"put %p %d\n" , sb,atomic_read (&lsi->lsi_mounts));if (atomic_dec_and_test (&lsi->lsi_mounts)) {if (IS_SERVER (lsi) && lsi->lsi_osd_exp) { +lu_device_put (&lsi->lsi_dt_dev->dd_lu_dev); + lsi->lsi_osd_exp->exp_obd->obd_lvfs_ctxt.dt =NULL ; + lsi->lsi_dt_dev =NULL ;obd_disconnect (lsi->lsi_osd_exp);/* wait till OSD is gone */ obd_zombie_barrier ();
Signature · 1 line
1.7.9.5
PATCH 3/16 staging/lustre/nfs: writing to new files will return ENOENT
In reply to Peng TaoFrom: Patrick Farrell <[email protected]>
This happend with SLES11SP2 Lustre client, which in turn acts as an NFS server, exporting a subtree of an Lustre fs through NFS.
We detected that whenever we are writing to a new file using, fx, 'echo blah > newfile', it will return ENOENT error. We found out that this was caused by the anonymous dentry. In SLESS11SP2, anonymous dentries are assigned '/' as the name, instead of an empty string. When MDT handles the intent_open call, it will look up the obj by the name if it is not an empty string, and thus couldn't find it.
As MDS_OPEN_BY_FID is always set on this request, we never need to send the name in this request. The fid is already available and should be used in case the file has been renamed.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3544
Lustre-change: http://review.whamcloud.com/6920
--- drivers/staging/lustre/lustre/llite/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +2 -3
@@ -368,8 +368,6 @@ static int ll_intent_file_open(struct file *file, void *lmm, {struct ll_sb_info *sbi =ll_i2sbi (file->f_dentry->d_inode);struct dentry *parent = file->f_dentry->d_parent; -const char *name = file->f_dentry->d_name.name; -const int len = file->f_dentry->d_name.len;struct md_op_data *op_data;struct ptlrpc_request *req;__u32 opc =LUSTRE_OPC_ANY ;
@@ -394,8 +392,9 @@ static int ll_intent_file_open(struct file *file, void *lmm, } op_data =ll_prep_md_op_data (NULL , parent->d_inode, - file->f_dentry->d_inode, name, len, + file->f_dentry->d_inode,NULL ,0 ,O_RDWR , opc,NULL ); +if (IS_ERR (op_data))return PTR_ERR (op_data);
Signature · 1 line
1.7.9.5
Patrick Farrell
Reviewed-by Bob Glossman Reviewed-by Alexey Shvetsov Reviewed-by Lai Siyao Reviewed-by James Simmons Reviewed-by Oleg Drokin on v1 3/16RE: [PATCH 03/16] staging/lustre/nfs: writing to new files will return ENOENT
Peng,
I'm sorry to say, this patch was reverted due to interoperability problems with 2.1 servers (This either a slightly later [but still broken] version of the patch we discussed recently, or the same one.). If Greg's accepted this upstream (and it looks like he has), it'll have to be reverted.
Sorry for the trouble here!
- Patrick
________________________________________
From: Peng Tao [[email protected]]
Sent: Monday, November 25, 2013 8:04 PM
To: Greg Kroah-Hartman
Cc: [email protected]; Patrick Farrell; Cheng Shao; Peng Tao; Andreas Dilger
Subject: [PATCH 03/16] staging/lustre/nfs: writing to new files will return ENOENT
From: Patrick Farrell <[email protected]>
This happend with SLES11SP2 Lustre client, which in turn acts as an NFS server, exporting a subtree of an Lustre fs through NFS.
We detected that whenever we are writing to a new file using, fx, 'echo blah > newfile', it will return ENOENT error. We found out that this was caused by the anonymous dentry. In SLESS11SP2, anonymous dentries are assigned '/' as the name, instead of an empty string. When MDT handles the intent_open call, it will look up the obj by the name if it is not an empty string, and thus couldn't find it.
As MDS_OPEN_BY_FID is always set on this request, we never need to send the name in this request. The fid is already available and should be used in case the file has been renamed.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3544
Lustre-change: http://review.whamcloud.com/6920
--- drivers/staging/lustre/lustre/llite/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +2 -3
@@ -368,8 +368,6 @@ static int ll_intent_file_open(struct file *file, void *lmm, {struct ll_sb_info *sbi =ll_i2sbi (file->f_dentry->d_inode);struct dentry *parent = file->f_dentry->d_parent; -const char *name = file->f_dentry->d_name.name; -const int len = file->f_dentry->d_name.len;struct md_op_data *op_data;struct ptlrpc_request *req;__u32 opc =LUSTRE_OPC_ANY ;
@@ -394,8 +392,9 @@ static int ll_intent_file_open(struct file *file, void *lmm, } op_data =ll_prep_md_op_data (NULL , parent->d_inode, - file->f_dentry->d_inode, name, len, + file->f_dentry->d_inode,NULL ,0 ,O_RDWR , opc,NULL ); +if (IS_ERR (op_data))return PTR_ERR (op_data);
--
1.7.9.5
Re: [PATCH 03/16] staging/lustre/nfs: writing to new files will return ENOENT
Quoted 4 lines · Patrick Farrell
Peng,
I'm sorry to say, this patch was reverted due to interoperability problems with 2.1 servers (This either a slightly later [but still broken] version of the patch we discussed recently, or the same one.). If Greg's accepted this upstream (and it looks like he has), it'll have to be reverted.
Sorry, my bad. I forgot to remove it from my patch queue after we discussed last time. I'll send a reverting patch. Sorry for the noise.
Thanks,
Tao
Quoted 69 lines
Sorry for the trouble here!
- Patrick
________________________________________
From: Peng Tao [[email protected]]
Sent: Monday, November 25, 2013 8:04 PM
To: Greg Kroah-Hartman
Cc: [email protected]; Patrick Farrell; Cheng Shao; Peng Tao; Andreas Dilger
Subject: [PATCH 03/16] staging/lustre/nfs: writing to new files will return ENOENTFrom: Patrick Farrell <[email protected]>
This happend with SLES11SP2 Lustre client, which in turn acts as an NFS server, exporting a subtree of an Lustre fs through NFS.
We detected that whenever we are writing to a new file using, fx, 'echo blah > newfile', it will return ENOENT error. We found out that this was caused by the anonymous dentry. In SLESS11SP2, anonymous dentries are assigned '/' as the name, instead of an empty string. When MDT handles the
intent_opencall, it will look up the obj by the name if it is not an empty string, and thus couldn't find it.As
MDS_OPEN_BY_FIDis always set on this request, we never need to send the name in this request. The fid is already available and should be used in case the file has been renamed.Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3544
Lustre-change: http://review.whamcloud.com/6920Signed-off-by Cheng Shao <[email protected]>Signed-off-by Patrick Farrell <[email protected]>Reviewed-by Bob Glossman <[email protected]>Reviewed-by Alexey Shvetsov <[email protected]>Reviewed-by Lai Siyao <[email protected]>Reviewed-by James Simmons <[email protected]>Reviewed-by Oleg Drokin <[email protected]>Signed-off-by Peng Tao <[email protected]>Signed-off-by Andreas Dilger <[email protected]>--- drivers/staging/lustre/lustre/llite/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/staging/lustre/lustre/llite/file.c +2
-4@@ -368,8 +368,6 @@ static int ll_intent_file_open(struct file *file, void *lmm, {struct ll_sb_info *sbi =ll_i2sbi (file->f_dentry->d_inode);struct dentry *parent = file->f_dentry->d_parent; -const char *name = file->f_dentry->d_name.name; -const int len = file->f_dentry->d_name.len;struct md_op_data *op_data;struct ptlrpc_request *req;__u32 opc =LUSTRE_OPC_ANY ;@@ -394,8 +392,9 @@ static int ll_intent_file_open(struct file *file, void *lmm, } op_data =ll_prep_md_op_data (NULL , parent->d_inode, - file->f_dentry->d_inode, name, len, + file->f_dentry->d_inode,NULL ,0 ,O_RDWR , opc,NULL ); +if (IS_ERR (op_data))return PTR_ERR (op_data); --1.7.9.5
PATCH 4/16 staging/lustre/ptlrpc: Fix race during exp_flock_hash creation
In reply to Peng TaoFrom: Andriy Skulysh <[email protected]>
During race exp_flock_hash can be created 2 times. It is created & assigned without any lock.
Move hash initialization from ldlm_flock_blocking_link() to ldlm_init_export()
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2835
Lustre-change: http://review.whamcloud.com/5471
--- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 28 +++++++---------------- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 +++++++ 2 files changed, 16 insertions(+), 20 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +8 -20
@@ -95,20 +95,12 @@ ldlm_flocks_overlap(struct ldlm_lock *lock, struct ldlm_lock *new) lock->l_policy_data.l_flock.start)); } -static inline int ldlm_flock_blocking_link (struct ldlm_lock *req, -struct ldlm_lock *lock) +static inline void ldlm_flock_blocking_link (struct ldlm_lock *req, +struct ldlm_lock *lock) { -int rc =0 ; -/* For server only */ if (req->l_export ==NULL ) -return 0 ; - -if (unlikely (req->l_export->exp_flock_hash ==NULL )) { - rc =ldlm_init_flock_export (req->l_export); -if (rc) - goto error; - } +return ;LASSERT (hlist_unhashed (&req->l_exp_flock_hash));
@@ -121,8 +113,6 @@ static inline int ldlm_flock_blocking_link(struct ldlm_lock *req,cfs_hash_add (req->l_export->exp_flock_hash, &req->l_policy_data.l_flock.owner, &req->l_exp_flock_hash); -error: -return rc; }static inline void ldlm_flock_blocking_unlink (struct ldlm_lock *req)
@@ -250,7 +240,6 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,int overlaps =0 ;int splitted =0 ;const struct ldlm_callback_suite null_cbs = {NULL }; -int rc; CDEBUG(D_DLMTRACE, "flags %#llx owner "LPU64" pid %u mode %u start " LPU64" end "LPU64"\n", *flags,
@@ -328,12 +317,8 @@ reprocess:/* add lock to blocking list before deadlock * check to prevent race */ - rc =ldlm_flock_blocking_link (req, lock); -if (rc) { -ldlm_flock_destroy (req, mode, *flags); - *err = rc; -return LDLM_ITER_STOP ; - } +ldlm_flock_blocking_link (req, lock); +if (ldlm_flock_deadlock (req, lock)) {ldlm_flock_blocking_unlink (req);ldlm_flock_destroy (req, mode, *flags);
@@ -813,6 +798,9 @@ static cfs_hash_ops_t ldlm_export_flock_ops = {int ldlm_init_flock_export (struct obd_export *exp) { +if (strcmp (exp->exp_obd->obd_type->typ_name,LUSTRE_MDT_NAME ) !=0 ) +return 0 ; + exp->exp_flock_hash = cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid), HASH_EXP_LOCK_CUR_BITS,
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +8 -0
@@ -964,6 +964,7 @@ static cfs_hash_ops_t ldlm_export_lock_ops = {int ldlm_init_export (struct obd_export *exp) { +int rc; exp->exp_lock_hash = cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid), HASH_EXP_LOCK_CUR_BITS,
@@ -977,7 +978,14 @@ int ldlm_init_export(struct obd_export *exp)if (!exp->exp_lock_hash)return -ENOMEM ; + rc =ldlm_init_flock_export (exp); +if (rc) +GOTO (err, rc); +return 0 ; +err: +ldlm_destroy_export (exp); +return rc; }EXPORT_SYMBOL (ldlm_init_export);
Signature · 1 line
1.7.9.5
PATCH 5/16 staging/lustre/mdc: prevent fall through in mdc_iocontrol()
In reply to Peng TaoFrom: "John L. Hammond" <[email protected]>
In mdc_iocontrol() add a goto to the end of the LL_IOC_HSM_STATE_SET case, preventing fall through into the next case. In the same function, replace the return statement in OBD_IOC_QUOTACTL with a goto, so that a reference to the module is not leaked.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3576
Lustre-change: http://review.whamcloud.com/6962
--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 27 +++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_request.c +13 -14
@@ -1743,6 +1743,7 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,GOTO (out, rc);case LL_IOC_HSM_STATE_SET : rc =mdc_ioc_hsm_state_set (exp, karg); +GOTO (out, rc);case LL_IOC_HSM_ACTION : rc =mdc_ioc_hsm_current_action (exp, karg);GOTO (out, rc);
@@ -1814,8 +1815,8 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,struct obd_quotactl *oqctl;OBD_ALLOC_PTR (oqctl); -if (!oqctl) -return -ENOMEM ; +if (oqctl ==NULL ) +GOTO (out, rc = -ENOMEM );QCTL_COPY (oqctl, qctl); rc =obd_quotactl (exp, oqctl);
@@ -1824,23 +1825,21 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, qctl->qc_valid =QC_MDTIDX ; qctl->obd_uuid = obd->u.cli.cl_target_uuid; } +OBD_FREE_PTR (oqctl); -break ; +GOTO (out, rc); } -case LL_IOC_GET_CONNECT_FLAGS : { -if (copy_to_user (uarg, -exp_connect_flags_ptr (exp), -sizeof (__u64))) +case LL_IOC_GET_CONNECT_FLAGS : +if (copy_to_user (uarg,exp_connect_flags_ptr (exp), +sizeof (*exp_connect_flags_ptr (exp))))GOTO (out, rc = -EFAULT ); -else -GOTO (out, rc =0 ); - } -case LL_IOC_LOV_SWAP_LAYOUTS : { + +GOTO (out, rc =0 ); +case LL_IOC_LOV_SWAP_LAYOUTS : rc =mdc_ioc_swap_layouts (exp, karg); -break ; - } +GOTO (out, rc);default : -CERROR ("mdc_ioctl(): unrecognised ioctl %#x\n" , cmd); +CERROR ("unrecognised ioctl: cmd = %#x\n" , cmd);GOTO (out, rc = -ENOTTY ); } out:
Signature · 1 line
1.7.9.5
PATCH 6/16 staging/lustre/lu: shrink lu_object by 8 bytes on x86_64
In reply to Peng TaoFrom: "John L. Hammond" <[email protected]>
Remove the lo_depth member from struct lu_object. This field is never set and only read in lu_object_print(). Remove the lo_flags member. This field was only used in lu_object_alloc() and can be replaced with an on-stack mask to keep trace of which layers have been allocated.
Lustre-change: http://review.whamcloud.com/5890
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3059
--- drivers/staging/lustre/lustre/include/lu_object.h | 19 ---------------- drivers/staging/lustre/lustre/obdclass/lu_object.c | 24 +++++++++++++------- 2 files changed, 16 insertions(+), 27 deletions(-)
drivers/staging/lustre/lustre/include/lu_object.h +0 -19
@@ -398,17 +398,6 @@ static inline int lu_device_is_md(const struct lu_device *d) }/** -* Flags for the object layers. -*/ -enum lu_object_flags { -/** -* this flags is set if lu_object_operations::loo_object_init() has -* been called for this layer. Used by lu_object_alloc(). -*/ -LU_OBJECT_ALLOCATED = (1 <<0 ) -}; - -/** * Common object attributes. */ struct lu_attr {
@@ -486,14 +475,6 @@ struct lu_object {*/ struct list_head lo_linkage;/** -* Depth. Top level layer depth is 0. -*/ -int lo_depth; -/** -* Flags from enum lu_object_flags. -*/ -__u32 lo_flags; -/** * Link to the device, for debugging. */ struct lu_ref_link lo_dev_ref;
drivers/staging/lustre/lustre/obdclass/lu_object.c +16 -8
@@ -200,6 +200,8 @@ static struct lu_object *lu_object_alloc(const struct lu_env *env,struct lu_object *scan;struct lu_object *top;struct list_head *layers; +unsigned int init_mask =0 ; +unsigned int init_flag;int clean;int result;
@@ -218,15 +220,17 @@ static struct lu_object *lu_object_alloc(const struct lu_env *env,*/ top->lo_header->loh_fid = *f; layers = &top->lo_header->loh_layers; + do { /* * Call ->loo_object_init() repeatedly, until no more new * object slices are created. */ clean = 1; + init_flag = 1; list_for_each_entry(scan, layers, lo_linkage) { - if (scan->lo_flags & LU_OBJECT_ALLOCATED) - continue; + if (init_mask & init_flag) + goto next; clean = 0; scan->lo_header = top->lo_header; result = scan->lo_ops->loo_object_init(env, scan, conf);
@@ -234,7 +238,9 @@ static struct lu_object *lu_object_alloc(const struct lu_env *env,lu_object_free (env, top);return ERR_PTR (result); } - scan->lo_flags |=LU_OBJECT_ALLOCATED ; + init_mask |= init_flag; +next: + init_flag <<=1 ; } }while (!clean);
@@ -487,23 +493,25 @@ void lu_object_print(const struct lu_env *env, void *cookie, {static const char ruler[] ="........................................" ;struct lu_object_header *top; -int depth; +int depth =4 ; top = o->lo_header;lu_object_header_print (env, cookie, printer, top); - (*printer)(env, cookie,"{ \n" ); -list_for_each_entry (o, &top->loh_layers, lo_linkage) { - depth = o->lo_depth +4 ; + (*printer)(env, cookie,"{\n" ); +list_for_each_entry (o, &top->loh_layers, lo_linkage) {/* * print `.' \a depth times followed by type name and address */ (*printer)(env, cookie,"%*.*s%s@%p" , depth, depth, ruler, o->lo_dev->ld_type->ldt_name, o); +if (o->lo_ops->loo_object_print !=NULL ) - o->lo_ops->loo_object_print (env, cookie, printer, o); + (*o->lo_ops->loo_object_print)(env, cookie, printer, o); + (*printer)(env, cookie,"\n" ); } + (*printer)(env, cookie,"} header@%p\n" , top); }EXPORT_SYMBOL (lu_object_print);
Signature · 1 line
1.7.9.5
PATCH 7/16 staging/lustre/mdt: HSM coordinator client interface
In reply to Peng TaoFrom: JC Lafoucriere <[email protected]>
This patch implements the HSM coordinator methods
used by client to add/remove/list HSM actions on
FID.
Lustre-change: http://review.whamcloud.com/6532
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3341
--- .../lustre/lustre/include/lustre/lustre_user.h | 7 +++---- drivers/staging/lustre/lustre/mdc/mdc_request.c | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +3 -4
@@ -1121,11 +1121,10 @@ static inline int hal_size(struct hsm_action_list *hal) sz =sizeof (*hal) +cfs_size_round (strlen (hal->hal_fsname)); hai =hai_zero (hal); -for (i =0 ; i < hal->hal_count ; i++) { +for (i =0 ; i < hal->hal_count; i++, hai =hai_next (hai)) sz +=cfs_size_round (hai->hai_len); - hai =hai_next (hai); - } -return (sz); + +return sz; }/* Copytool progress reporting */
drivers/staging/lustre/lustre/mdc/mdc_request.c +1 -3
@@ -1919,10 +1919,8 @@ static void lustre_swab_hal(struct hsm_action_list *h)__swab32s (&h->hal_archive_id);__swab64s (&h->hal_flags); hai =hai_zero (h); -for (i =0 ; i < h->hal_count; i++) { +for (i =0 ; i < h->hal_count; i++, hai =hai_next (hai))lustre_swab_hai (hai); - hai =hai_next (hai); - } }static void lustre_swab_kuch (struct kuc_hdr *l)
Signature · 1 line
1.7.9.5
PATCH 8/16 staging/lustre/mdt: HSM coordinator agent interface
In reply to Peng TaoFrom: JC Lafoucriere <[email protected]>
To move data with external storage, HSM coordinator uses a Copy Tool running on a client named agent. This patch implements the interface for these agents.
Lustre-change: http://review.whamcloud.com/6534
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3342
--- .../lustre/lustre/include/lustre/lustre_user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +3 -3
@@ -428,8 +428,8 @@ struct obd_uuid {char uuid[UUID_MAX ]; }; -static inline int obd_uuid_equals (const struct obd_uuid *u1, -const struct obd_uuid *u2) +static inline bool obd_uuid_equals (const struct obd_uuid *u1, +const struct obd_uuid *u2) {return strcmp ((char *)u1->uuid, (char *)u2->uuid) ==0 ; }
@@ -446,7 +446,7 @@ static inline void obd_str2uuid(struct obd_uuid *uuid, const char *tmp) }/* For printf's only, make sure uuid is terminated */ -static inline char *obd_uuid2str (struct obd_uuid *uuid) +static inline char *obd_uuid2str (const struct obd_uuid *uuid) {if (uuid->uuid[sizeof (*uuid) -1 ] !='\0' ) {/* Obviously not safe, but for printfs, no real harm done...
Signature · 1 line
1.7.9.5
Greg Kroah-Hartman
maintainerRe: [PATCH 08/16] staging/lustre/mdt: HSM coordinator agent interface
Quoted 5 lines · Peng Tao
From: JC Lafoucriere <[email protected]>
To move data with external storage, HSM coordinator uses a Copy Tool running on a client named agent. This patch implements the interface for these agents.
Interesting text here...
Quoted 29 lines
Lustre-change: http://review.whamcloud.com/6534
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3342Signed-off-by JC Lafoucriere <[email protected]>Reviewed-by Jinshan Xiong <[email protected]>Reviewed-by Andreas Dilger <[email protected]>Reviewed-by John L. Hammond <[email protected]>Reviewed-by Oleg Drokin <[email protected]>Signed-off-by Peng Tao <[email protected]>Signed-off-by Andreas Dilger <[email protected]>--- .../lustre/lustre/include/lustre/lustre_user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/lustre/lustre/include/lustre/lustre_user.h +2
-2@@ -428,8 +428,8 @@ struct obd_uuid {char uuid[UUID_MAX ]; }; -static inline int obd_uuid_equals (const struct obd_uuid *u1, -const struct obd_uuid *u2) +static inline bool obd_uuid_equals (const struct obd_uuid *u1, +const struct obd_uuid *u2) {return strcmp ((char *)u1->uuid, (char *)u2->uuid) ==0 ; }
drivers/staging/lustre/lustre/include/lustre/lustre_user.h static inline void obd_str2uuid(struct obd_uuid *uuid, const char *tmp) · line 452
Quoted 8 lines
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +1
-1@@ -446,7 +446,7 @@ static inline void obd_str2uuid(struct obd_uuid *uuid, const char *tmp) }/* For printf's only, make sure uuid is terminated */ -static inline char *obd_uuid2str (struct obd_uuid *uuid) +static inline char *obd_uuid2str (const struct obd_uuid *uuid) {if (uuid->uuid[sizeof (*uuid) -1 ] !='\0' ) {/* Obviously not safe, but for printfs, no real harm done...
Too bad it doesn't describe the changes made in the code at all.
How can so many people review a patch that is not the same as what it says it really is?
I'm stopping here in the series, sorry. Please fix up and resend the rest when you can.
greg k-h
Re: [PATCH 08/16] staging/lustre/mdt: HSM coordinator agent interface
Quoted 49 lines · Greg Kroah-Hartman
Quoted 5 lines · Peng Tao
From: JC Lafoucriere <[email protected]>
To move data with external storage, HSM coordinator uses a Copy Tool running on a client named agent. This patch implements the interface for these agents.
Interesting text here...
Quoted 29 lines
Lustre-change: http://review.whamcloud.com/6534
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3342Signed-off-by JC Lafoucriere <[email protected]>Reviewed-by Jinshan Xiong <[email protected]>Reviewed-by Andreas Dilger <[email protected]>Reviewed-by John L. Hammond <[email protected]>Reviewed-by Oleg Drokin <[email protected]>Signed-off-by Peng Tao <[email protected]>Signed-off-by Andreas Dilger <[email protected]>--- .../lustre/lustre/include/lustre/lustre_user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/lustre/lustre/include/lustre/lustre_user.h +2
-2@@ -428,8 +428,8 @@ struct obd_uuid {char uuid[UUID_MAX ]; }; -static inline int obd_uuid_equals (const struct obd_uuid *u1, -const struct obd_uuid *u2) +static inline bool obd_uuid_equals (const struct obd_uuid *u1, +const struct obd_uuid *u2) {return strcmp ((char *)u1->uuid, (char *)u2->uuid) ==0 ; }drivers/staging/lustre/lustre/include/lustre/lustre_user.h static inline void obd_str2uuid(struct obd_uuid *uuid, const char *tmp) · line 452
Quoted 8 lines
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +1
-1@@ -446,7 +446,7 @@ static inline void obd_str2uuid(struct obd_uuid *uuid, const char *tmp) }/* For printf's only, make sure uuid is terminated */ -static inline char *obd_uuid2str (struct obd_uuid *uuid) +static inline char *obd_uuid2str (const struct obd_uuid *uuid) {if (uuid->uuid[sizeof (*uuid) -1 ] !='\0' ) {/* Obviously not safe, but for printfs, no real harm done... Too bad it doesn't describe the changes made in the code at all.
Quoted 3 lines
How can so many people review a patch that is not the same as what it says it really is?
The main part of the original commit is dropped as it only touches server code. I should have modified the commit message to say what exactly the patch does rather than just copying the original commit message. I'll fix up. Sorry.
Quoted 3 lines
I'm stopping here in the series, sorry. Please fix up and resend the rest when you can.
Will do. Thanks for reviewing!
Thanks,
Tao
PATCH 9/16 staging/lustre/scrub: OI scrub on OST
In reply to Peng TaoFrom: Fan Yong <[email protected]>
OI scrub should has the ability to handle kinds of OI, including both the OI files on MDT and the /O directory on OST.
We trust the FID in LMA for both MDT objects and OST objects. So if some /O sub-item does not match related LMA, then the /O will be updated, instead of the LMA.
To guarantee that the OI scrub can run without MDT0 involved for FLDB, the OST object needs to store some flag in its LMA to tell OI scrub that it is for an OST object, no need to query the MDT0.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3335
Lustre-change: http://review.whamcloud.com/6669
--- .../lustre/lustre/include/lustre/lustre_idl.h | 18 +++++++++++------- .../staging/lustre/lustre/include/obd_support.h | 1 + drivers/staging/lustre/lustre/obdclass/md_attrs.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 4 ++++ 4 files changed, 18 insertions(+), 9 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +11 -7
@@ -321,8 +321,11 @@ static inline int range_compare_loc(const struct lu_seq_range *r1,* xattr. */ enum lma_compat { -LMAC_HSM =0x00000001 , -LMAC_SOM =0x00000002 , +LMAC_HSM =0x00000001 , +LMAC_SOM =0x00000002 , +LMAC_NOT_IN_OI =0x00000004 ,/* the object does NOT need OI mapping */ +LMAC_FID_ON_OST =0x00000008 ,/* For OST-object, its OI mapping is +* under /O/<seq>/d<x>. */ };/**
@@ -331,16 +334,17 @@ enum lma_compat {* This information is stored in lustre_mdt_attrs::lma_incompat. */ enum lma_incompat { -LMAI_RELEASED =0x0000001 ,/* file is released */ -LMAI_AGENT =0x00000002 ,/* agent inode */ -LMAI_REMOTE_PARENT =0x00000004 ,/* the parent of the object -is on the remote MDT */ +LMAI_RELEASED =0x00000001 ,/* file is released */ +LMAI_AGENT =0x00000002 ,/* agent inode */ +LMAI_REMOTE_PARENT =0x00000004 ,/* the parent of the object +is on the remote MDT */ };#define LMA_INCOMPAT_SUPP (LMAI_AGENT | LMAI_REMOTE_PARENT)extern void lustre_lma_swab (struct lustre_mdt_attrs *lma);extern void lustre_lma_init (struct lustre_mdt_attrs *lma, -const struct lu_fid *fid,__u32 incompat); +const struct lu_fid *fid, +__u32 compat,__u32 incompat);/** * SOM on-disk attributes stored in a separate xattr. */
drivers/staging/lustre/lustre/include/obd_support.h +1 -0
@@ -256,6 +256,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,#define OBD_FAIL_OSD_SCRUB_FATAL 0x192#define OBD_FAIL_OSD_FID_MAPPING 0x193#define OBD_FAIL_OSD_LMA_INCOMPAT 0x194 +#define OBD_FAIL_OSD_COMPAT_INVALID_ENTRY 0x195#define OBD_FAIL_OST 0x200#define OBD_FAIL_OST_CONNECT_NET 0x201
drivers/staging/lustre/lustre/obdclass/md_attrs.c +2 -2
@@ -39,9 +39,9 @@* \param incompat - features that MDS must understand to access object */ void lustre_lma_init (struct lustre_mdt_attrs *lma,const struct lu_fid *fid, -__u32 incompat) +__u32 compat,__u32 incompat) { - lma->lma_compat =0 ; + lma->lma_compat = compat; lma->lma_incompat = incompat; lma->lma_self_fid = *fid;
drivers/staging/lustre/lustre/ptlrpc/wiretest.c +4 -0
@@ -433,6 +433,10 @@ void lustre_assert_wire_constants(void) (unsigned)LMAC_HSM);LASSERTF (LMAC_SOM ==0x00000002UL ,"found 0x%.8xUL\n" , (unsigned )LMAC_SOM ); +LASSERTF (LMAC_NOT_IN_OI ==0x00000004UL ,"found 0x%.8xUL\n" , + (unsigned )LMAC_NOT_IN_OI ); +LASSERTF (LMAC_FID_ON_OST ==0x00000008UL ,"found 0x%.8xUL\n" , + (unsigned )LMAC_FID_ON_OST );LASSERTF (OBJ_CREATE ==1 ,"found %lld\n" , (long long )OBJ_CREATE ); LASSERTF(OBJ_DESTROY == 2, "found %lld\n",
Signature · 1 line
1.7.9.5
PATCH 1/1 staging/lustre/llite: extended attribute cache
In reply to Peng TaoFrom: Andrew Perepechko <[email protected]>
This patch implements an extended attribute cache for a Lustre client. It is organized as a write-through
cache: reads are performed from cache, updates are sent synchronously to the MDS. An additional inode bit MDS_INODELOCK_XATTR is added to protect the cache.
Lustre-change: http://review.whamcloud.com/5537
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2869
--- .../lustre/lustre/include/linux/lustre_lite.h | 1 + .../lustre/lustre/include/lustre/lustre_idl.h | 12 +- .../lustre/lustre/include/lustre_req_layout.h | 3 + drivers/staging/lustre/lustre/include/md_object.h | 4 +- drivers/staging/lustre/lustre/include/obd.h | 5 + .../staging/lustre/lustre/include/obd_support.h | 1 + drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 + drivers/staging/lustre/lustre/llite/Makefile | 2 +- drivers/staging/lustre/lustre/llite/file.c | 13 +- .../staging/lustre/lustre/llite/llite_internal.h | 36 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 23 +- drivers/staging/lustre/lustre/llite/lproc_llite.c | 37 ++ drivers/staging/lustre/lustre/llite/namei.c | 4 + drivers/staging/lustre/lustre/llite/super25.c | 4 + drivers/staging/lustre/lustre/llite/xattr.c | 102 ++-- drivers/staging/lustre/lustre/llite/xattr_cache.c | 640 ++++++++++++++++++++ drivers/staging/lustre/lustre/mdc/mdc_internal.h | 1 + drivers/staging/lustre/lustre/mdc/mdc_locks.c | 63 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 34 ++ 19 files changed, 925 insertions(+), 62 deletions(-) create mode 100644 drivers/staging/lustre/lustre/llite/xattr_cache.c
drivers/staging/lustre/lustre/include/linux/lustre_lite.h +1 -0
@@ -88,6 +88,7 @@ enum {LPROC_LL_ALLOC_INODE ,LPROC_LL_SETXATTR ,LPROC_LL_GETXATTR , +LPROC_LL_GETXATTR_HITS ,LPROC_LL_LISTXATTR ,LPROC_LL_REMOVEXATTR , LPROC_LL_INODE_PERM,
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +9 -3
@@ -1369,7 +1369,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); OBD_CONNECT_EINPROGRESS | \ OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_UMASK | \ OBD_CONNECT_LVB_TYPE | OBD_CONNECT_LAYOUTLOCK |\ - OBD_CONNECT_PINGLESS) + OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE)#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \ OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \ OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
@@ -1753,7 +1753,9 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)#define OBD_MD_FLCKSPLIT (0x0000080000000000ULL)/* Check split on server */ #define OBD_MD_FLCROSSREF (0x0000100000000000ULL)/* Cross-ref case */ #define OBD_MD_FLGETATTRLOCK (0x0000200000000000ULL)/* Get IOEpoch attributes -* under lock */ +* under lock; for xattr +* requests means the +* client holds the lock */ #define OBD_MD_FLOBJCOUNT (0x0000400000000000ULL)/* for multiple destroy */ #define OBD_MD_FLRMTLSETFACL (0x0001000000000000ULL)/* lfs lsetfacl case */
@@ -1770,6 +1772,9 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic) OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \ OBD_MD_FLGENER | OBD_MD_FLRDEV | OBD_MD_FLGROUP) +#define OBD_MD_FLXATTRLOCKED OBD_MD_FLGETATTRLOCK +#define OBD_MD_FLXATTRALL (OBD_MD_FLXATTR | OBD_MD_FLXATTRLS) +/* don't forget obdo_fid which is way down at the bottom so it can * come after the definition of llog_cookie */
@@ -2142,8 +2147,9 @@ extern void lustre_swab_generic_32s (__u32 *val);#define MDS_INODELOCK_OPEN 0x000004/* For opened files */ #define MDS_INODELOCK_LAYOUT 0x000008/* for layout */ #define MDS_INODELOCK_PERM 0x000010/* for permission */ +#define MDS_INODELOCK_XATTR 0x000020/* extended attributes */ -#define MDS_INODELOCK_MAXSHIFT 4 +#define MDS_INODELOCK_MAXSHIFT 5/* This FULL lock is useful to take on unlink sort of operations */ #define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
drivers/staging/lustre/lustre/include/lustre_req_layout.h +3 -0
@@ -230,6 +230,7 @@ extern struct req_format RQF_LDLM_INTENT_GETATTR;extern struct req_format RQF_LDLM_INTENT_OPEN ;extern struct req_format RQF_LDLM_INTENT_CREATE ;extern struct req_format RQF_LDLM_INTENT_UNLINK ; +extern struct req_format RQF_LDLM_INTENT_GETXATTR ;extern struct req_format RQF_LDLM_INTENT_QUOTA ;extern struct req_format RQF_LDLM_CANCEL ;extern struct req_format RQF_LDLM_CALLBACK ;
@@ -279,6 +280,8 @@ extern struct req_msg_field RMF_LAYOUT_INTENT;extern struct req_msg_field RMF_MDT_MD ;extern struct req_msg_field RMF_REC_REINT ;extern struct req_msg_field RMF_EADATA ; +extern struct req_msg_field RMF_EAVALS ; +extern struct req_msg_field RMF_EAVALS_LENS ;extern struct req_msg_field RMF_ACL ;extern struct req_msg_field RMF_LOGCOOKIES ;extern struct req_msg_field RMF_CAPA1 ;
drivers/staging/lustre/lustre/include/md_object.h +2 -2
@@ -352,8 +352,8 @@ struct md_device_operations {int (*mdo_root_get)(const struct lu_env *env,struct md_device *m,struct lu_fid *f); -int (*mdo_maxsize_get)(const struct lu_env *env,struct md_device *m, -int *md_size,int *cookie_size); +int (*mdo_maxeasize_get)(const struct lu_env *env,struct md_device *m, +int *easize);int (*mdo_statfs)(const struct lu_env *env,struct md_device *m,struct obd_statfs *sfs);
drivers/staging/lustre/lustre/include/obd.h +5 -0
@@ -1022,6 +1022,7 @@ struct lu_context;#define IT_LAYOUT (1 << 10)#define IT_QUOTA_DQACQ (1 << 11)#define IT_QUOTA_CONN (1 << 12) +#define IT_SETXATTR (1 << 13)static inline int it_to_lock_mode (struct lookup_intent *it) {
@@ -1031,6 +1032,10 @@ static inline int it_to_lock_mode(struct lookup_intent *it)else if (it->it_op & (IT_READDIR |IT_GETATTR |IT_OPEN |IT_LOOKUP |IT_LAYOUT ))return LCK_CR ; +else if (it->it_op &IT_GETXATTR ) +return LCK_PR ; +else if (it->it_op &IT_SETXATTR ) +return LCK_PW ;LASSERTF (0 ,"Invalid it_op: %d\n" , it->it_op);return -EINVAL ;
drivers/staging/lustre/lustre/include/obd_support.h +1 -0
@@ -466,6 +466,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,#define OBD_FAIL_LOCK_STATE_WAIT_INTR 0x1402#define OBD_FAIL_LOV_INIT 0x1403#define OBD_FAIL_GLIMPSE_DELAY 0x1404 +#define OBD_FAIL_LLITE_XATTR_ENOMEM 0x1405#define OBD_FAIL_FID_INDIR 0x1501#define OBD_FAIL_FID_INLMA 0x1502
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +2 -0
@@ -145,6 +145,8 @@ char *ldlm_it2str(int it)return "getxattr" ;case IT_LAYOUT :return "layout" ; +case IT_SETXATTR : +return "setxattr" ;default :CERROR ("Unknown intent %d\n" , it);return "UNKNOWN" ;
drivers/staging/lustre/lustre/llite/Makefile +1 -1
@@ -2,7 +2,7 @@ obj-$(CONFIG_LUSTRE_FS) += lustre.o obj-$(CONFIG_LUSTRE_LLITE_LLOOP) += llite_lloop.o lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \ rw.o lproc_llite.o namei.o symlink.o llite_mmap.o \ - xattr.o remote_perm.o llite_rmtacl.o llite_capa.o \ + xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o llite_capa.o \ rw26.o super25.o statahead.o \ ../lclient/glimpse.o ../lclient/lcommon_cl.o ../lclient/lcommon_misc.o \ vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o
drivers/staging/lustre/lustre/llite/file.c +8 -5
@@ -2783,7 +2783,8 @@ int ll_have_md_lock(struct inode *inode, __u64 *bits, ldlm_mode_t l_req_mode) }ldlm_mode_t ll_take_md_lock (struct inode *inode,__u64 bits, -struct lustre_handle *lockh,__u64 flags) +struct lustre_handle *lockh,__u64 flags, +ldlm_mode_t mode) {ldlm_policy_data_t policy = { .l_inodebits = {bits}};struct lu_fid *fid;
@@ -2793,8 +2794,8 @@ ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,CDEBUG (D_INFO ,"trying to match res " DFID "\n" ,PFID (fid)); rc =md_lock_match (ll_i2mdexp (inode),LDLM_FL_BLOCK_GRANTED |flags, - fid,LDLM_IBITS , &policy, -LCK_CR |LCK_CW |LCK_PR |LCK_PW , lockh); + fid,LDLM_IBITS , &policy, mode, lockh); +return rc; }
@@ -3470,7 +3471,8 @@ int ll_layout_refresh(struct inode *inode, __u32 *gen)/* mostly layout lock is caching on the local side, so try to match * it before grabbing layout lock mutex. */ - mode =ll_take_md_lock (inode,MDS_INODELOCK_LAYOUT , &lockh,0 ); + mode =ll_take_md_lock (inode,MDS_INODELOCK_LAYOUT , &lockh,0 , +LCK_CR |LCK_CW |LCK_PR |LCK_PW );if (mode !=0 ) {/* hit cached lock */ rc =ll_layout_lock_set (&lockh, mode, inode, gen, false);if (rc ==0 )
@@ -3485,7 +3487,8 @@ int ll_layout_refresh(struct inode *inode, __u32 *gen) again:/* try again. Maybe somebody else has done this. */ - mode =ll_take_md_lock (inode,MDS_INODELOCK_LAYOUT , &lockh,0 ); + mode =ll_take_md_lock (inode,MDS_INODELOCK_LAYOUT , &lockh,0 , +LCK_CR |LCK_CW |LCK_PR |LCK_PW );if (mode !=0 ) {/* hit cached lock */ rc =ll_layout_lock_set (&lockh, mode, inode, gen, true);if (rc == -EAGAIN )
drivers/staging/lustre/lustre/llite/llite_internal.h +33 -3
@@ -127,6 +127,8 @@ enum lli_flags {LLIF_DATA_MODIFIED = (1 <<6 ),/* File is being restored */ LLIF_FILE_RESTORING = (1 <<7 ), +/* Xattr cache is attached to the file */ + LLIF_XATTR_CACHE = (1 << 8), }; struct ll_inode_info {
@@ -279,8 +281,27 @@ struct ll_inode_info {struct mutex lli_layout_mutex;/* valid only inside LAYOUT ibits lock, protected by lli_layout_mutex */ __u32 lli_layout_gen; + +struct rw_semaphore lli_xattrs_list_rwsem; +struct mutex lli_xattrs_enq_lock; +struct list_head lli_xattrs;/* ll_xattr_entry->xe_list */ }; +int ll_xattr_cache_destroy (struct inode *inode); + +int ll_xattr_cache_get (struct inode *inode, +const char *name, +char *buffer, +size_t size, +__u64 valid); + +int ll_xattr_cache_update (struct inode *inode, +const char *name, +const char *newval, +size_t size, +__u64 valid, +int flags); +/* * Locking to guarantee consistency of non-atomic updates to long long i_size, * consistency between file size and KMS.
@@ -402,6 +423,7 @@ enum stats_track_type {#define LL_SBI_VERBOSE 0x10000/* verbose mount/umount */ #define LL_SBI_LAYOUT_LOCK 0x20000/* layout lock support */ #define LL_SBI_USER_FID2PATH 0x40000/* allow fid2path by unprivileged users */ +#define LL_SBI_XATTR_CACHE 0x80000/* support for xattr cache */ #define LL_SBI_FLAGS { \ "nolck", \
@@ -409,6 +431,7 @@ enum stats_track_type {"flock" , \"xattr" , \"acl" , \ +"???" , \"rmt_client" , \"mds_capa" , \ "oss_capa", \
@@ -421,7 +444,9 @@ enum stats_track_type {"agl" , \"verbose" , \"layout" , \ - "user_fid2path" } +"user_fid2path" ,\ +"xattr" , \ +} /* default value for ll_sb_info->contention_time */ #define SBI_DEFAULT_CONTENTION_SECONDS 60
@@ -461,7 +486,8 @@ struct ll_sb_info {struct lu_fid ll_root_fid;/* root object fid */ int ll_flags; - unsigned int ll_umounting:1; + unsigned int ll_umounting:1, + ll_xattr_cache_enabled:1;struct list_head ll_conn_chain;/* per-conn chain of SBs */ struct lustre_client_ocd ll_lco;
@@ -732,7 +758,8 @@ extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,extern int ll_have_md_lock (struct inode *inode,__u64 *bits,ldlm_mode_t l_req_mode);extern ldlm_mode_t ll_take_md_lock (struct inode *inode,__u64 bits, -struct lustre_handle *lockh,__u64 flags); +struct lustre_handle *lockh,__u64 flags, +ldlm_mode_t mode);int __ll_inode_revalidate_it (struct dentry *,struct lookup_intent *,__u64 bits);int ll_revalidate_nd (struct dentry *dentry,unsigned int flags);
@@ -1598,4 +1625,7 @@ int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf);int ll_layout_refresh (struct inode *inode,__u32 *gen);int ll_layout_restore (struct inode *inode); +int ll_xattr_init (void ); +void ll_xattr_fini (void ); +#endif /* LLITE_INTERNAL_H */
drivers/staging/lustre/lustre/llite/llite_lib.c +21 -2
@@ -209,7 +209,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,OBD_CONNECT_FULL20 |OBD_CONNECT_64BITHASH |OBD_CONNECT_EINPROGRESS |OBD_CONNECT_JOBSTATS |OBD_CONNECT_LVB_TYPE | -OBD_CONNECT_LAYOUTLOCK |OBD_CONNECT_PINGLESS ; +OBD_CONNECT_LAYOUTLOCK | +OBD_CONNECT_PINGLESS |OBD_CONNECT_MAX_EASIZE ;if (sbi->ll_flags &LL_SBI_SOM_PREVIEW ) data->ocd_connect_flags |=OBD_CONNECT_SOM ;
@@ -383,6 +384,17 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, sbi->ll_flags |=LL_SBI_LAYOUT_LOCK ; } +if (data->ocd_ibits_known &MDS_INODELOCK_XATTR ) { +if (!(data->ocd_connect_flags &OBD_CONNECT_MAX_EASIZE )) { +LCONSOLE_INFO ( +"%s: disabling xattr cache due to unknown maximum xattr size.\n" , + dt); + }else { + sbi->ll_flags |=LL_SBI_XATTR_CACHE ; + sbi->ll_xattr_cache_enabled =1 ; + } + } + obd =class_name2obd (dt);if (!obd) {CERROR ("DT %s: not setup or attached\n" , dt);
@@ -922,6 +934,9 @@ void ll_lli_init(struct ll_inode_info *lli) lli->lli_layout_gen =LL_LAYOUT_GEN_NONE ; lli->lli_clob =NULL ; +init_rwsem (&lli->lli_xattrs_list_rwsem); +mutex_init (&lli->lli_xattrs_enq_lock); +LASSERT (lli->lli_vfs_inode.i_mode !=0 );if (S_ISDIR (lli->lli_vfs_inode.i_mode)) {mutex_init (&lli->lli_readdir_mutex);
@@ -1194,6 +1209,8 @@ void ll_clear_inode(struct inode *inode) lli->lli_symlink_name =NULL ; } +ll_xattr_cache_destroy (inode); +if (sbi->ll_flags &LL_SBI_RMT_CLIENT ) {LASSERT (lli->lli_posix_acl ==NULL );if (lli->lli_remote_perms) {
@@ -1752,7 +1769,9 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)* lock on the client and set LLIF_MDS_SIZE_LOCK holding * it. */ mode =ll_take_md_lock (inode,MDS_INODELOCK_UPDATE , - &lockh,LDLM_FL_CBPENDING ); + &lockh,LDLM_FL_CBPENDING , +LCK_CR |LCK_CW | +LCK_PR |LCK_PW );if (mode) { if (lli->lli_flags & (LLIF_DONE_WRITING | LLIF_EPOCH_PENDING |
drivers/staging/lustre/lustre/llite/lproc_llite.c +37 -0
@@ -723,6 +723,41 @@ static int ll_sbi_flags_seq_show(struct seq_file *m, void *v) }LPROC_SEQ_FOPS_RO (ll_sbi_flags); +static int ll_xattr_cache_seq_show (struct seq_file *m,void *v) +{ +struct super_block *sb = m->private; +struct ll_sb_info *sbi =ll_s2sbi (sb); +int rc; + + rc =seq_printf (m,"%u\n" , sbi->ll_xattr_cache_enabled); + +return rc; +} + +static ssize_t ll_xattr_cache_seq_write (struct file *file,const char *buffer, +size_t count,loff_t *off) +{ +struct seq_file *seq = file->private_data; +struct super_block *sb = seq->private; +struct ll_sb_info *sbi =ll_s2sbi (sb); +int val, rc; + + rc =lprocfs_write_helper (buffer, count, &val); +if (rc) +return rc; + +if (val !=0 && val !=1 ) +return -ERANGE ; + +if (val ==1 && !(sbi->ll_flags &LL_SBI_XATTR_CACHE )) +return -ENOTSUPP ; + + sbi->ll_xattr_cache_enabled = val; + +return count; +} +LPROC_SEQ_FOPS (ll_xattr_cache); +static struct lprocfs_vars lprocfs_llite_obd_vars[] = { {"uuid" , &ll_sb_uuid_fops,0 ,0 },//{ "mntpt_path", ll_rd_path, 0, 0 },
@@ -751,6 +786,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = { { "lazystatfs", &ll_lazystatfs_fops, 0 }, { "max_easize", &ll_maxea_size_fops, 0, 0 }, { "sbi_flags", &ll_sbi_flags_fops, 0, 0 }, + { "xattr_cache", &ll_xattr_cache_fops, 0, 0 }, { 0 } };
@@ -802,6 +838,7 @@ struct llite_file_opcode { { LPROC_LL_ALLOC_INODE, LPROCFS_TYPE_REGS, "alloc_inode" }, { LPROC_LL_SETXATTR, LPROCFS_TYPE_REGS, "setxattr" }, { LPROC_LL_GETXATTR, LPROCFS_TYPE_REGS, "getxattr" }, + { LPROC_LL_GETXATTR_HITS, LPROCFS_TYPE_REGS, "getxattr_hits" }, { LPROC_LL_LISTXATTR, LPROCFS_TYPE_REGS, "listxattr" }, { LPROC_LL_REMOVEXATTR, LPROCFS_TYPE_REGS, "removexattr" }, { LPROC_LL_INODE_PERM, LPROCFS_TYPE_REGS, "inode_permission" },
drivers/staging/lustre/lustre/llite/namei.c +4 -0
@@ -222,6 +222,10 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,break ;LASSERT (lock->l_flags &LDLM_FL_CANCELING ); + +if (bits &MDS_INODELOCK_XATTR ) +ll_xattr_cache_destroy (inode); +/* For OPEN locks we differentiate between lock modes * LCK_CR, LCK_CW, LCK_PR - bug 22891 */ if (bits & (MDS_INODELOCK_LOOKUP | MDS_INODELOCK_UPDATE |
drivers/staging/lustre/lustre/llite/super25.c +4 -0
@@ -187,11 +187,15 @@ static int __init init_lustre_lite(void)if (rc ==0 ) rc =vvp_global_init (); +if (rc ==0 ) + rc =ll_xattr_init (); +return rc; } static void __exit exit_lustre_lite(void) { +ll_xattr_fini ();vvp_global_fini ();del_timer (&ll_capa_timer);ll_capa_thread_stop ();
drivers/staging/lustre/lustre/llite/xattr.c +57 -45
135 lines not on this page · raw message
drivers/staging/lustre/lustre/llite/xattr_cache.c new file +640 -0
640 lines not on this page · raw message
drivers/staging/lustre/lustre/mdc/mdc_internal.h +1 -0
@@ -72,6 +72,7 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data, __u32 mode, __u64 rdev, __u64 flags, const void *data, int datalen);void mdc_unlink_pack (struct ptlrpc_request *req,struct md_op_data *op_data); +void mdc_getxattr_pack (struct ptlrpc_request *req,struct md_op_data *op_data);void mdc_link_pack (struct ptlrpc_request *req,struct md_op_data *op_data);void mdc_rename_pack (struct ptlrpc_request *req,struct md_op_data *op_data,const char *old,int oldlen,const char *new,int newlen);
drivers/staging/lustre/lustre/mdc/mdc_locks.c +62 -1
89 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/layout.c +34 -0
@@ -462,6 +462,25 @@ static const struct req_msg_field *ldlm_intent_unlink_client[] = { &RMF_NAME }; +static const struct req_msg_field *ldlm_intent_getxattr_client[] = { + &RMF_PTLRPC_BODY , + &RMF_DLM_REQ , + &RMF_LDLM_INTENT , + &RMF_MDT_BODY , + &RMF_CAPA1 , +}; + +static const struct req_msg_field *ldlm_intent_getxattr_server[] = { + &RMF_PTLRPC_BODY , + &RMF_DLM_REP , + &RMF_MDT_BODY , + &RMF_MDT_MD , + &RMF_ACL ,/* for req_capsule_extend/mdt_intent_policy */ + &RMF_EADATA , + &RMF_EAVALS , + &RMF_EAVALS_LENS +}; +static const struct req_msg_field *mds_getxattr_client[] = { &RMF_PTLRPC_BODY , &RMF_MDT_BODY ,
@@ -739,6 +758,7 @@ static struct req_format *req_formats[] = { &RQF_LDLM_INTENT_OPEN , &RQF_LDLM_INTENT_CREATE , &RQF_LDLM_INTENT_UNLINK , + &RQF_LDLM_INTENT_GETXATTR , &RQF_LDLM_INTENT_QUOTA , &RQF_QUOTA_DQACQ , &RQF_LOG_CANCEL,
@@ -1013,6 +1033,9 @@ struct req_msg_field RMF_EADATA = DEFINE_MSGF("eadata", 0, -1, NULL, NULL);EXPORT_SYMBOL (RMF_EADATA ); +struct req_msg_field RMF_EAVALS =DEFINE_MSGF ("eavals" ,0 ,-1 ,NULL ,NULL ); +EXPORT_SYMBOL (RMF_EAVALS ); +struct req_msg_field RMF_ACL =DEFINE_MSGF ("acl" ,RMF_F_NO_SIZE_CHECK ,LUSTRE_POSIX_ACL_MAX_SIZE ,NULL ,NULL );
@@ -1064,6 +1087,11 @@ struct req_msg_field RMF_RCS = lustre_swab_generic_32s, dump_rcs);EXPORT_SYMBOL (RMF_RCS ); +struct req_msg_field RMF_EAVALS_LENS = +DEFINE_MSGF ("eavals_lens" ,RMF_F_STRUCT_ARRAY ,sizeof (__u32), + lustre_swab_generic_32s,NULL ); +EXPORT_SYMBOL (RMF_EAVALS_LENS ); +struct req_msg_field RMF_OBD_ID =DEFINE_MSGF ("obd_id" ,0 ,sizeof (obd_id), lustre_swab_ost_last_id,NULL );
@@ -1421,6 +1449,12 @@ struct req_format RQF_LDLM_INTENT_UNLINK = ldlm_intent_unlink_client, ldlm_intent_server);EXPORT_SYMBOL (RQF_LDLM_INTENT_UNLINK ); +struct req_format RQF_LDLM_INTENT_GETXATTR = +DEFINE_REQ_FMT0 ("LDLM_INTENT_GETXATTR" , + ldlm_intent_getxattr_client, + ldlm_intent_getxattr_server); +EXPORT_SYMBOL (RQF_LDLM_INTENT_GETXATTR ); +struct req_format RQF_MDS_CLOSE =DEFINE_REQ_FMT0 ("MDS_CLOSE" , mdt_close_client, mds_last_unlink_server);
Signature · 1 line
1.7.9.5
PATCH 10/16 staging/lustre/scrub: control OI scrub on OST from user space
In reply to Peng TaoFrom: Fan Yong <[email protected]>
Not all the OI inconsistency can be detected automatically, such as /O entry lost case. So the OI scrub on OST should can be triggered by the administrator manually.
Lustre-change: http://review.whamcloud.com/6698
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3335
--- .../staging/lustre/lustre/include/obd_support.h | 1 + 1 file changed, 1 insertion(+)
drivers/staging/lustre/lustre/include/obd_support.h +1 -0
@@ -257,6 +257,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,#define OBD_FAIL_OSD_FID_MAPPING 0x193#define OBD_FAIL_OSD_LMA_INCOMPAT 0x194#define OBD_FAIL_OSD_COMPAT_INVALID_ENTRY 0x195 +#define OBD_FAIL_OSD_COMPAT_NO_ENTRY 0x196#define OBD_FAIL_OST 0x200#define OBD_FAIL_OST_CONNECT_NET 0x201
Signature · 1 line
1.7.9.5
PATCH 11/16 staging/lustre/llite: don't check for O_CREAT in it_create_mode
In reply to Peng TaoFrom: "John L. Hammond" <[email protected]>
ll_lookup_it() checks for O_CREAT in struct lookup_intent's it_create_mode member which is nonsensical, as it_create_mode is used for file mode bits (S_IFREG, S_IRUSR, ...). Fix this by just checking for IT_CREATE in it_op and do the same in llu_lookup_it(). This will not affect the behavior of either function, since if O_CREATE (0100) is actually set in o_create_mode then IT_CREATE must have been set in it_op. In ll_atomic_open() check for O_CREAT in the open_flags parameter rather than testing mode.
Lustre-change: http://review.whamcloud.com/6786
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3517
--- drivers/staging/lustre/lustre/llite/namei.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/llite/namei.c +2 -3
@@ -523,8 +523,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, icbd.icbd_childp = &dentry; icbd.icbd_parent = parent; -if (it->it_op &IT_CREAT || - (it->it_op &IT_OPEN && it->it_create_mode &O_CREAT )) +if (it->it_op &IT_CREAT ) opc =LUSTRE_OPC_CREATE ;else opc =LUSTRE_OPC_ANY ;
@@ -623,7 +622,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry,return -ENOMEM ; it->it_op =IT_OPEN ; -if (mode) { +if (open_flags &O_CREAT ) { it->it_op |=IT_CREAT ; lookup_flags |=LOOKUP_CREATE ; }
Signature · 1 line
1.7.9.5
PATCH 12/16 staging/lustre/build: clean up unused variables and dead code
In reply to Peng TaoFrom: Dmitry Eremin <[email protected]>
Clean up the code from really unused variables and rearrange other to remove SET_BUT_UNUSED and UNUSED macro usage if possible.
Clean up or comment on some dead code.
Removed never implemented suspend timeouts functionality from pinger.c which was commented out since 2007 and going to be replaced by adaptive timeouts. Also removed all references to this functionality from ldlm_lockd.c, ldlm_request.c and import.c which actually nevers executes or do nothing.
pinger.c commit d2d56f38da01001c92a09afc6b52b5acbd9bc13c
Author: tappro <tappro>
Date: Mon Jul 30 21:08:59 2007 +0000
- make HEAD from b_post_cmd3
Lustre-change: http://review.whamcloud.com/6139
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3204
--- .../staging/lustre/include/linux/libcfs/libcfs.h | 2 - drivers/staging/lustre/lnet/selftest/rpc.c | 2 - drivers/staging/lustre/lnet/selftest/selftest.h | 3 - drivers/staging/lustre/lnet/selftest/timer.c | 6 +- .../lustre/lustre/include/linux/lustre_compat25.h | 4 +- drivers/staging/lustre/lustre/include/lustre_ha.h | 3 - drivers/staging/lustre/lustre/include/lustre_net.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 3 - drivers/staging/lustre/lustre/libcfs/workitem.c | 56 ++++++++--------- drivers/staging/lustre/lustre/llite/dcache.c | 36 ++++------- drivers/staging/lustre/lustre/llite/namei.c | 6 +- .../lustre/lustre/obdclass/lprocfs_status.c | 4 -- drivers/staging/lustre/lustre/ptlrpc/client.c | 10 ++- drivers/staging/lustre/lustre/ptlrpc/import.c | 2 - drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 ++- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 65 -------------------- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 44 ++++++------- 17 files changed, 76 insertions(+), 182 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs.h +0 -2
@@ -181,8 +181,6 @@ static inline void *__container_of(void *ptr, unsigned long shift)#define container_of0 (ptr, type, member) \ ((type *)__container_of((void *)(ptr), offsetof(type, member))) -#define SET_BUT_UNUSED (a) do { } while(sizeof(a) - sizeof(a)) -#define _LIBCFS_H#endif /* _LIBCFS_H */
drivers/staging/lustre/lnet/selftest/rpc.c +0 -2
@@ -124,7 +124,6 @@ srpc_bulk_t * srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink) { srpc_bulk_t *bk; -struct page **pages;int i;LASSERT (bulk_npg >0 && bulk_npg <=LNET_MAX_IOV );
@@ -140,7 +139,6 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink) bk->bk_sink = sink; bk->bk_len = bulk_len; bk->bk_niov = bulk_npg; -UNUSED (pages);for (i =0 ; i < bulk_npg; i++) {struct page *pg;
drivers/staging/lustre/lnet/selftest/selftest.h +0 -3
@@ -572,9 +572,6 @@ swi_state2str (int state)#undef STATE2STR } -#define UNUSED (x) ( (void)(x) ) - -#define selftest_wait_events () cfs_pause(cfs_time_seconds(1) / 10)
drivers/staging/lustre/lnet/selftest/timer.c +2 -4
@@ -172,9 +172,6 @@ int stt_timer_main(void *arg) {int rc =0 ; -UNUSED (arg); - -SET_BUT_UNUSED (rc);cfs_block_allsigs ();
@@ -184,12 +181,13 @@ stt_timer_main(void *arg) rc =wait_event_timeout (stt_data.stt_waitq, stt_data.stt_shuttingdown,cfs_time_seconds (STTIMER_SLOTTIME )); + rc =0 ;/* Discard jiffies remaining before timeout. */ }spin_lock (&stt_data.stt_lock); stt_data.stt_nthreads--;spin_unlock (&stt_data.stt_lock); -return 0 ; +return rc; }int
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +2 -2
@@ -171,8 +171,8 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)#define ll_d_hlist_empty (list) hlist_empty(list)#define ll_d_hlist_entry (ptr, type, name) hlist_entry(ptr.first, type, name)#define ll_d_hlist_for_each (tmp, i_dentry) hlist_for_each(tmp, i_dentry) -#define ll_d_hlist_for_each_entry (dentry, p, i_dentry, alias) \ - p = NULL; hlist_for_each_entry(dentry, i_dentry, alias) +#define ll_d_hlist_for_each_entry (dentry, i_dentry, alias) \ + hlist_for_each_entry(dentry, i_dentry, alias)#define bio_hw_segments (q, bio) 0
drivers/staging/lustre/lustre/include/lustre_ha.h +0 -3
@@ -58,9 +58,6 @@ void ptlrpc_activate_import(struct obd_import *imp);void ptlrpc_deactivate_import (struct obd_import *imp);void ptlrpc_invalidate_import (struct obd_import *imp);void ptlrpc_fail_import (struct obd_import *imp,__u32 conn_cnt); -int ptlrpc_check_suspend (void ); -void ptlrpc_activate_timeouts (struct obd_import *imp); -void ptlrpc_deactivate_timeouts (struct obd_import *imp);/** @} ha */
drivers/staging/lustre/lustre/include/lustre_net.h +0 -2
@@ -3403,10 +3403,8 @@ int ptlrpc_del_timeout_client(struct list_head *obd_list, enum timeout_event event);struct ptlrpc_request *ptlrpc_prep_ping (struct obd_import *imp);int ptlrpc_obd_ping (struct obd_device *obd); -cfs_time_t ptlrpc_suspend_wakeup_time (void );void ping_evictor_start (void );void ping_evictor_stop (void ); -int ptlrpc_check_and_wait_suspend (struct ptlrpc_request *req);void ptlrpc_pinger_ir_up (void );void ptlrpc_pinger_ir_down (void );/** @} */
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -3
@@ -97,9 +97,6 @@ int ldlm_expired_completion_wait(void *data)if (lock->l_conn_export ==NULL ) {static cfs_time_t next_dump =0 , last_dump =0 ; -if (ptlrpc_check_suspend ()) -return 0 ; - LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", " CFS_DURATION_T"s ago)\n", lock->l_last_activity,
drivers/staging/lustre/lustre/libcfs/workitem.c +27 -29
90 lines not on this page · raw message
drivers/staging/lustre/lustre/llite/dcache.c +13 -23
@@ -270,7 +270,6 @@ void ll_intent_release(struct lookup_intent *it)void ll_invalidate_aliases (struct inode *inode) {struct dentry *dentry; -struct ll_d_hlist_node *p;LASSERT (inode !=NULL );
@@ -278,7 +277,7 @@ void ll_invalidate_aliases(struct inode *inode) inode->i_ino, inode->i_generation, inode);ll_lock_dcache (inode); -ll_d_hlist_for_each_entry (dentry, p, &inode->i_dentry, d_alias) { +ll_d_hlist_for_each_entry (dentry, &inode->i_dentry, d_alias) { CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p " "inode %p flags %d\n", dentry->d_name.len, dentry->d_name.name, dentry, dentry->d_parent,
@@ -404,7 +403,6 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,struct inode *inode = de->d_inode;struct ll_inode_info *lli =ll_i2info (inode);struct obd_client_handle **och_p; -__u64 *och_usecount;__u64 ibits;/*
@@ -417,38 +415,30 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,* change, LOOKUP lock is revoked. */ - -if (it->it_flags &FMODE_WRITE ) { +if (it->it_flags &FMODE_WRITE ) och_p = &lli->lli_mds_write_och; - och_usecount = &lli->lli_open_fd_write_count; - }else if (it->it_flags &FMODE_EXEC ) { +else if (it->it_flags &FMODE_EXEC ) och_p = &lli->lli_mds_exec_och; - och_usecount = &lli->lli_open_fd_exec_count; - }else { +else och_p = &lli->lli_mds_read_och; - och_usecount = &lli->lli_open_fd_read_count; - }/* Check for the proper lock. */ ibits =MDS_INODELOCK_LOOKUP ;if (!ll_have_md_lock (inode, &ibits,LCK_MINMODE )) goto do_lock;mutex_lock (&lli->lli_och_mutex);if (*och_p) {/* Everything is open already, do nothing */ -/*(*och_usecount)++; Do not let them steal our open -handle from under us */ -SET_BUT_UNUSED (och_usecount); -/* XXX The code above was my original idea, but in case -we have the handle, but we cannot use it due to later -checks (e.g. O_CREAT|O_EXCL flags set), nobody -would decrement counter increased here. So we just -hope the lock won't be invalidated in between. But -if it would be, we'll reopen the open request to -MDS later during file open path */ +/* Originally it was idea to do not let them steal our +* open handle from under us by (*och_usecount)++ here. +* But in case we have the handle, but we cannot use it +* due to later checks (e.g. O_CREAT|O_EXCL flags set), +* nobody would decrement counter increased here. So we +* just hope the lock won't be invalidated in between. +* But if it would be, we'll reopen the open request to +* MDS later during file open path. */ mutex_unlock (&lli->lli_och_mutex);return 1 ; - }else { -mutex_unlock (&lli->lli_och_mutex); } +mutex_unlock (&lli->lli_och_mutex); }if (it->it_op ==IT_GETATTR ) {
drivers/staging/lustre/lustre/llite/namei.c +2 -4
@@ -172,10 +172,9 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,static void ll_invalidate_negative_children (struct inode *dir) {struct dentry *dentry, *tmp_subdir; -struct ll_d_hlist_node *p;ll_lock_dcache (dir); -ll_d_hlist_for_each_entry (dentry, p, &dir->i_dentry, d_alias) { +ll_d_hlist_for_each_entry (dentry, &dir->i_dentry, d_alias) {spin_lock (&dentry->d_lock);if (!list_empty (&dentry->d_subdirs)) {struct dentry *child;
@@ -352,7 +351,6 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2)static struct dentry *ll_find_alias (struct inode *inode,struct dentry *dentry) {struct dentry *alias, *discon_alias, *invalid_alias; -struct ll_d_hlist_node *p;if (ll_d_hlist_empty (&inode->i_dentry))return NULL ;
@@ -360,7 +358,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) discon_alias = invalid_alias =NULL ;ll_lock_dcache (inode); -ll_d_hlist_for_each_entry (alias, p, &inode->i_dentry, d_alias) { +ll_d_hlist_for_each_entry (alias, &inode->i_dentry, d_alias) {LASSERT (alias != dentry);spin_lock (&alias->d_lock);
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +0 -4
@@ -420,7 +420,6 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, {unsigned int num_entry;struct lprocfs_counter *percpu_cntr; -struct lprocfs_counter_header *cntr_header;int i;unsigned long flags =0 ;
@@ -439,7 +438,6 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,for (i =0 ; i < num_entry; i++) {if (stats->ls_percpu[i] ==NULL )continue ; - cntr_header = &stats->ls_cnt_header[idx]; percpu_cntr =lprocfs_stats_counter_get (stats, i, idx); cnt->lc_count += percpu_cntr->lc_count;
@@ -999,7 +997,6 @@ EXPORT_SYMBOL(lprocfs_free_stats);void lprocfs_clear_stats (struct lprocfs_stats *stats) {struct lprocfs_counter *percpu_cntr; -struct lprocfs_counter_header *header;int i;int j;unsigned int num_entry;
@@ -1011,7 +1008,6 @@ void lprocfs_clear_stats(struct lprocfs_stats *stats)if (stats->ls_percpu[i] ==NULL )continue ;for (j =0 ; j < stats->ls_num; j++) { - header = &stats->ls_cnt_header[j]; percpu_cntr =lprocfs_stats_counter_get (stats, i, j); percpu_cntr->lc_count =0 ; percpu_cntr->lc_min =LC_MIN_INIT ;
drivers/staging/lustre/lustre/ptlrpc/client.c +4 -6
@@ -2289,7 +2289,6 @@ EXPORT_SYMBOL(ptlrpc_req_xid);int ptlrpc_unregister_reply (struct ptlrpc_request *request,int async) {int rc; -wait_queue_head_t *wq;struct l_wait_info lwi;/*
@@ -2334,12 +2333,11 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)* a chance to run reply_in_callback(), and to make sure we've * unlinked before returning a req to the pool. */ -if (request->rq_set !=NULL ) - wq = &request->rq_set->set_waitq; -else - wq = &request->rq_reply_waitq; -for (;;) { +/* The wq argument is ignored by user-space wait_event macros */ +wait_queue_head_t *wq = (request->rq_set !=NULL ) ? + &request->rq_set->set_waitq : + &request->rq_reply_waitq;/* Network access will complete in finite time but the HUGE * timeout lets us CWARN for visibility of sluggish NALs */ lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
drivers/staging/lustre/lustre/ptlrpc/import.c +0 -2
@@ -170,7 +170,6 @@ int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt) target_len, target_start, libcfs_nid2str(imp->imp_connection->c_peer.nid)); } -ptlrpc_deactivate_timeouts (imp);IMPORT_SET_STATE_NOLOCK (imp,LUSTRE_IMP_DISCON );spin_unlock (&imp->imp_lock);
@@ -383,7 +382,6 @@ void ptlrpc_activate_import(struct obd_import *imp)spin_lock (&imp->imp_lock); imp->imp_invalid =0 ; -ptlrpc_activate_timeouts (imp);spin_unlock (&imp->imp_lock);obd_import_event (obd, imp,IMP_EVENT_ACTIVE ); }
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +4 -6
@@ -243,7 +243,6 @@ EXPORT_SYMBOL(ptlrpc_register_bulk);int ptlrpc_unregister_bulk (struct ptlrpc_request *req,int async) {struct ptlrpc_bulk_desc *desc = req->rq_bulk; -wait_queue_head_t *wq;struct l_wait_info lwi;int rc;
@@ -275,12 +274,11 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)if (async)return 0 ; -if (req->rq_set !=NULL ) - wq = &req->rq_set->set_waitq; -else - wq = &req->rq_reply_waitq; -for (;;) { +/* The wq argument is ignored by user-space wait_event macros */ +wait_queue_head_t *wq = (req->rq_set !=NULL ) ? + &req->rq_set->set_waitq : + &req->rq_reply_waitq;/* Network access will complete in finite time but the HUGE * timeout lets us CWARN for visibility of sluggish NALs */ lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
drivers/staging/lustre/lustre/ptlrpc/pinger.c +0 -65
83 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +22 -22
75 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 13/16 staging/lustre/build: fix compilation issue with is_compat_task
In reply to Peng TaoFrom: Dmitry Eremin <[email protected]>
After removing LIBCFS_HAVE_IS_COMPAT_TASK test we have a compilation issue with kernels configured without CONFIG_COMPAT.
Lustre-change: http://review.whamcloud.com/7118
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2800
--- .../staging/lustre/lustre/llite/llite_internal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/llite_internal.h +6 -1
@@ -650,7 +650,12 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi)#if BITS_PER_LONG ==32 return 1 ;#else -return unlikely (is_compat_task () || (sbi->ll_flags &LL_SBI_32BIT_API )); + return unlikely( +#ifdef CONFIG_COMPAT +is_compat_task () || +#endif + (sbi->ll_flags &LL_SBI_32BIT_API ) + ); #endif }
Signature · 1 line
1.7.9.5
PATCH 14/16 staging/lustre/ptlrpc: Fix a crash when dereferencing NULL pointer
In reply to Peng TaoFrom: Amir Shehata <[email protected]>
When a system runs out of memory and the function ptlrpc_register_bulk() is called from ptl_send_rpc() the call to LNetMEAttach() fails due to failure to allocate memory. This forces the code into an error path, which most probably previously went untested. The error path:
if (rc != 0) {
CERROR("%s: LNetMEAttach failed x"LPU64"/%d: rc = %dn",
desc->bd_export->exp_obd->obd_name, xid,
posted_md, rc);
break;
}This print assumes that desc->bd_export is not NULL. However, it is. In fact it is expected to be NULL. desc->bd_import is the correct structure to access in this case.
Lustre-change: http://review.whamcloud.com/7121
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3585
--- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +3 -3
@@ -180,7 +180,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req) LNET_UNLINK, LNET_INS_AFTER, &me_h);if (rc !=0 ) {CERROR ("%s: LNetMEAttach failed x" LPU64 "/%d: rc = %d\n" , - desc->bd_export->exp_obd->obd_name, xid, + desc->bd_import->imp_obd->obd_name, xid, posted_md, rc);break ; }
@@ -190,7 +190,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req) &desc->bd_mds[posted_md]);if (rc !=0 ) {CERROR ("%s: LNetMDAttach failed x" LPU64 "/%d: rc = %d\n" , - desc->bd_export->exp_obd->obd_name, xid, + desc->bd_import->imp_obd->obd_name, xid, posted_md, rc); rc2 =LNetMEUnlink (me_h);LASSERT (rc2 ==0 );
@@ -220,7 +220,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)/* Holler if peer manages to touch buffers before he knows the xid */ if (desc->bd_md_count != total_md)CWARN ("%s: Peer %s touched %d buffers while I registered\n" , - desc->bd_export->exp_obd->obd_name,libcfs_id2str (peer), + desc->bd_import->imp_obd->obd_name,libcfs_id2str (peer), total_md - desc->bd_md_count);spin_unlock (&desc->bd_lock);
Signature · 1 line
1.7.9.5
PATCH 15/16 staging/lustre/hsm: Add hsm_release feature.
In reply to Peng TaoFrom: Jinshan Xiong <[email protected]>
HSM Release is one of the key feature of HSM. To perform HSM release, clients need to acquire the file lease exclusivelt and flush dirty cache from clients. A special close REQ will be sent to the MDT to release the lease and get rid of OST objects.
Lustre-change: http://review.whamcloud.com/7028
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1333
--- .../lustre/lustre/include/lustre/lustre_idl.h | 14 +++- .../lustre/lustre/include/lustre/lustre_user.h | 11 ++- .../lustre/lustre/include/lustre_req_layout.h | 2 + drivers/staging/lustre/lustre/include/obd.h | 6 +- .../staging/lustre/lustre/lclient/lcommon_misc.c | 4 +- drivers/staging/lustre/lustre/llite/dir.c | 24 +++++- drivers/staging/lustre/lustre/llite/file.c | 87 +++++++++++++++++--- .../staging/lustre/lustre/llite/llite_internal.h | 3 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 2 +- .../staging/lustre/lustre/lov/lov_cl_internal.h | 16 ++++ drivers/staging/lustre/lustre/lov/lov_object.c | 35 +++++--- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 26 +++++- drivers/staging/lustre/lustre/mdc/mdc_request.c | 23 +++++- drivers/staging/lustre/lustre/ptlrpc/layout.c | 19 +++++ .../staging/lustre/lustre/ptlrpc/pack_generic.c | 7 ++ 15 files changed, 242 insertions(+), 37 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +13 -1
@@ -1762,6 +1762,7 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)#define OBD_MD_FLRMTRGETFACL (0x0008000000000000ULL)/* lfs rgetfacl case */ #define OBD_MD_FLDATAVERSION (0x0010000000000000ULL)/* iversion sum */ +#define OBD_MD_FLRELEASED (0x0020000000000000ULL)/* file released */ #define OBD_MD_FLGETATTR (OBD_MD_FLID | OBD_MD_FLATIME | OBD_MD_FLMTIME | \ OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLKSZ | \
@@ -2398,6 +2399,7 @@ extern void lustre_swab_mdt_rec_setattr (struct mdt_rec_setattr *sa);* delegation, succeed if it's not * being opened with conflict mode. */ +#define MDS_OPEN_RELEASE 02000000000000ULL/* Open the file for HSM release */ /* permission for create non-directory file */ #define MAY_CREATE (1 << 7)
@@ -2416,7 +2418,7 @@ extern void lustre_swab_mdt_rec_setattr (struct mdt_rec_setattr *sa);/* lfs rgetfacl permission check */ #define MAY_RGETFACL (1 << 14) -enum { +enum mds_op_bias {MDS_CHECK_SPLIT =1 <<0 ,MDS_CROSS_REF =1 <<1 ,MDS_VTX_BYPASS =1 <<2 ,
@@ -2429,6 +2431,7 @@ enum {MDS_DATA_MODIFIED =1 <<9 ,MDS_CREATE_VOLATILE =1 <<10 ,MDS_OWNEROVERRIDE =1 <<11 , + MDS_HSM_RELEASE = 1 << 12, };/* instance of mdt_reint_rec */
@@ -3752,5 +3755,14 @@ struct mdc_swap_layouts {void lustre_swab_swap_layouts (struct mdc_swap_layouts *msl); +struct close_data { +struct lustre_handle cd_handle; +struct lu_fid cd_fid; +__u64 cd_data_version; +__u64 cd_reserved[8 ]; +}; + +void lustre_swab_close_data (struct close_data *data); +#endif /** @} lustreidl */
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +7 -4
@@ -623,10 +623,13 @@ struct if_quotactl { };/* swap layout flags */ -#define SWAP_LAYOUTS_CHECK_DV1 (1 << 0) -#define SWAP_LAYOUTS_CHECK_DV2 (1 << 1) -#define SWAP_LAYOUTS_KEEP_MTIME (1 << 2) -#define SWAP_LAYOUTS_KEEP_ATIME (1 << 3) +#define SWAP_LAYOUTS_CHECK_DV1 (1 << 0) +#define SWAP_LAYOUTS_CHECK_DV2 (1 << 1) +#define SWAP_LAYOUTS_KEEP_MTIME (1 << 2) +#define SWAP_LAYOUTS_KEEP_ATIME (1 << 3) + +/* Swap XATTR_NAME_HSM as well, only on the MDT so far */ +#define SWAP_LAYOUTS_MDS_HSM (1 << 31)struct lustre_swap_layouts {__u64 sl_flags;__u32 sl_fd;
drivers/staging/lustre/lustre/include/lustre_req_layout.h +2 -0
@@ -164,6 +164,7 @@ extern struct req_format RQF_UPDATE_OBJ;*/ extern struct req_format RQF_MDS_GETATTR_NAME ;extern struct req_format RQF_MDS_CLOSE ; +extern struct req_format RQF_MDS_RELEASE_CLOSE ;extern struct req_format RQF_MDS_PIN ;extern struct req_format RQF_MDS_UNPIN ;extern struct req_format RQF_MDS_CONNECT ;
@@ -262,6 +263,7 @@ extern struct req_msg_field RMF_GETINFO_VAL;extern struct req_msg_field RMF_GETINFO_VALLEN ;extern struct req_msg_field RMF_GETINFO_KEY ;extern struct req_msg_field RMF_IDX_INFO ; +extern struct req_msg_field RMF_CLOSE_DATA ;/* * connection handle received in MDS_CONNECT request.
drivers/staging/lustre/lustre/include/obd.h +5 -1
@@ -1070,7 +1070,7 @@ struct md_op_data {struct obd_capa *op_capa2;/* Various operation flags. */ -__u32 op_bias; +enum mds_op_bias op_bias;/* Operation type */ __u32 op_opc;
@@ -1084,6 +1084,10 @@ struct md_op_data {/* used to transfer info between the stacks of MD client * see enum op_cli_flags */ __u32 op_cli_flags; + +/* File object data version for HSM release, on client */ +__u64 op_data_version; +struct lustre_handle op_lease_handle; };enum op_cli_flags {
drivers/staging/lustre/lustre/lclient/lcommon_misc.c +3 -1
@@ -140,7 +140,9 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock, rc =cl_io_init (env, io,CIT_MISC , io->ci_obj);if (rc) { -LASSERT (rc <0 ); +/* Does not make sense to take GL for released layout */ +if (rc >0 ) + rc = -ENOTSUPP ;cl_env_put (env, &refcheck);return rc; }
drivers/staging/lustre/lustre/llite/dir.c +22 -2
@@ -1809,8 +1809,28 @@ out_rmdir:return -EFAULT ; } - rc =obd_iocontrol (cmd,ll_i2mdexp (inode), totalsize, - hur,NULL ); +if (hur->hur_request.hr_action ==HUA_RELEASE ) { +const struct lu_fid *fid; +struct inode *f; +int i; + +for (i =0 ; i < hur->hur_request.hr_itemcount; i++) { + fid = &hur->hur_user_item[i].hui_fid; + f =search_inode_for_lustre (inode->i_sb, fid); +if (IS_ERR (f)) { + rc =PTR_ERR (f); +break ; + } + + rc =ll_hsm_release (f); +iput (f); +if (rc !=0 ) +break ; + } + }else { + rc =obd_iocontrol (cmd,ll_i2mdexp (inode), totalsize, + hur,NULL ); + }OBD_FREE_LARGE (hur, totalsize);
drivers/staging/lustre/lustre/llite/file.c +75 -12
165 lines not on this page · raw message
drivers/staging/lustre/lustre/llite/llite_internal.h +2 -1
@@ -787,9 +787,10 @@ int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg);int ll_put_grouplock (struct inode *inode,struct file *file,unsigned long arg);int ll_fid2path (struct inode *inode,void *arg);int ll_data_version (struct inode *inode,__u64 *data_version,int extent_lock); +int ll_hsm_release (struct inode *inode);struct obd_client_handle *ll_lease_open (struct inode *inode,struct file *file, -fmode_t mode); +fmode_t mode,__u64 flags);int ll_lease_close (struct obd_client_handle *och,struct inode *inode,bool *lease_broken);
drivers/staging/lustre/lustre/llite/vvp_object.c +1 -1
@@ -138,7 +138,7 @@ int vvp_conf_set(const struct lu_env *env, struct cl_object *obj, lli->lli_layout_gen, conf->u.coc_md->lsm->lsm_layout_gen); - lli->lli_has_smd = true; + lli->lli_has_smd =lsm_has_objects (conf->u.coc_md->lsm); lli->lli_layout_gen = conf->u.coc_md->lsm->lsm_layout_gen; }else { CDEBUG(D_VFSTRACE, "layout lock destroyed: %u.\n",
drivers/staging/lustre/lustre/lov/lov_cl_internal.h +16 -0
@@ -168,6 +168,22 @@ enum lov_layout_type { LLT_NR }; +static inline char *llt2str (enum lov_layout_type llt) +{ +switch (llt) { +case LLT_EMPTY : +return "EMPTY" ; +case LLT_RAID0 : +return "RAID0" ; +case LLT_RELEASED : +return "RELEASED" ; +case LLT_NR : +LBUG (); + } +LBUG (); +return "" ; +} +/** * lov-specific file state. *
drivers/staging/lustre/lustre/lov/lov_object.c +25 -10
@@ -393,13 +393,13 @@ static int lov_print_empty(const struct lu_env *env, void *cookie,static int lov_print_raid0 (const struct lu_env *env,void *cookie,lu_printer_t p,const struct lu_object *o) { -struct lov_object *lov =lu2lov (o); -struct lov_layout_raid0 *r0 =lov_r0 (lov); -struct lov_stripe_md *lsm = lov->lo_lsm; -int i; +struct lov_object *lov =lu2lov (o); +struct lov_layout_raid0 *r0 =lov_r0 (lov); +struct lov_stripe_md *lsm = lov->lo_lsm; +int i; - (*p)(env, cookie,"stripes: %d, %svalid, lsm{%p 0x%08X %d %u %u}: \n" , - r0->lo_nr, lov->lo_layout_invalid ?"in" :"" , lsm, + (*p)(env, cookie,"stripes: %d, %s, lsm{%p 0x%08X %d %u %u}:\n" , + r0->lo_nr, lov->lo_layout_invalid ?"invalid" :"valid" , lsm, lsm->lsm_magic,atomic_read (&lsm->lsm_refc), lsm->lsm_stripe_count, lsm->lsm_layout_gen);for (i =0 ; i < r0->lo_nr; ++i) {
@@ -408,8 +408,9 @@ static int lov_print_raid0(const struct lu_env *env, void *cookie,if (r0->lo_sub[i] !=NULL ) { sub =lovsub2lu (r0->lo_sub[i]);lu_object_print (env, cookie, p, sub); - }else + }else { (*p)(env, cookie,"sub %d absent\n" , i); + } }return 0 ; }
@@ -417,7 +418,14 @@ static int lov_print_raid0(const struct lu_env *env, void *cookie,static int lov_print_released (const struct lu_env *env,void *cookie,lu_printer_t p,const struct lu_object *o) { - (*p)(env, cookie,"released\n" ); +struct lov_object *lov =lu2lov (o); +struct lov_stripe_md *lsm = lov->lo_lsm; + + (*p)(env, cookie, +"released: %s, lsm{%p 0x%08X %d %u %u}:\n" , + lov->lo_layout_invalid ?"invalid" :"valid" , lsm, + lsm->lsm_magic,atomic_read (&lsm->lsm_refc), + lsm->lsm_stripe_count, lsm->lsm_layout_gen);return 0 ; }
@@ -662,6 +670,10 @@ static int lov_layout_change(const struct lu_env *unused,return PTR_ERR (env); } +CDEBUG (D_INODE ,DFID " from %s to %s\n" , +PFID (lu_object_fid (lov2lu (lov))), +llt2str (lov->lo_type),llt2str (llt)); + old_ops = &lov_dispatch[lov->lo_type]; new_ops = &lov_dispatch[llt];
@@ -750,8 +762,9 @@ static int lov_conf_set(const struct lu_env *env, struct cl_object *obj,if (conf->u.coc_md !=NULL ) lsm = conf->u.coc_md->lsm;if ((lsm ==NULL && lov->lo_lsm ==NULL ) || - (lsm !=NULL && lov->lo_lsm !=NULL && - lov->lo_lsm->lsm_layout_gen == lsm->lsm_layout_gen)) { + ((lsm !=NULL && lov->lo_lsm !=NULL ) && + (lov->lo_lsm->lsm_layout_gen == lsm->lsm_layout_gen) && + (lov->lo_lsm->lsm_pattern == lsm->lsm_pattern))) {/* same version of layout */ lov->lo_layout_invalid = false;GOTO (out, result =0 );
@@ -767,6 +780,8 @@ static int lov_conf_set(const struct lu_env *env, struct cl_object *obj, out:lov_conf_unlock (lov); +CDEBUG (D_INODE ,DFID " lo_layout_invalid=%d\n" , +PFID (lu_object_fid (lov2lu (lov))), lov->lo_layout_invalid);return result; }
drivers/staging/lustre/lustre/mdc/mdc_lib.c +25 -1
@@ -179,7 +179,8 @@ static __u64 mds_pack_open_flags(__u64 flags, __u32 mode)__u64 cr_flags = (flags & (FMODE_READ |FMODE_WRITE |MDS_OPEN_HAS_EA |MDS_OPEN_HAS_OBJS |MDS_OPEN_OWNEROVERRIDE |MDS_OPEN_LOCK | -MDS_OPEN_BY_FID |MDS_OPEN_LEASE )); +MDS_OPEN_BY_FID |MDS_OPEN_LEASE | +MDS_OPEN_RELEASE ));if (flags &O_CREAT ) cr_flags |=MDS_OPEN_CREAT ;if (flags &O_EXCL )
@@ -490,6 +491,28 @@ void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, int flags, } } +static void mdc_hsm_release_pack (struct ptlrpc_request *req, +struct md_op_data *op_data) +{ +if (op_data->op_bias &MDS_HSM_RELEASE ) { +struct close_data *data; +struct ldlm_lock *lock; + + data =req_capsule_client_get (&req->rq_pill, &RMF_CLOSE_DATA ); +LASSERT (data !=NULL ); + + lock =ldlm_handle2lock (&op_data->op_lease_handle); +if (lock !=NULL ) { + data->cd_handle = lock->l_remote_handle; +ldlm_lock_put (lock); + } +ldlm_cli_cancel (&op_data->op_lease_handle,LCF_LOCAL ); + + data->cd_data_version = op_data->op_data_version; + data->cd_fid = op_data->op_fid2; + } +} +void mdc_close_pack (struct ptlrpc_request *req,struct md_op_data *op_data) {struct mdt_ioepoch *epoch;
@@ -501,6 +524,7 @@ void mdc_close_pack(struct ptlrpc_request *req, struct md_op_data *op_data)mdc_setattr_pack_rec (rec, op_data);mdc_pack_capa (req, &RMF_CAPA1 , op_data->op_capa1);mdc_ioepoch_pack (epoch, op_data); +mdc_hsm_release_pack (req, op_data); }static int mdc_req_avail (struct client_obd *cli,struct mdc_cache_waiter *mcw)
drivers/staging/lustre/lustre/mdc/mdc_request.c +20 -3
@@ -800,10 +800,27 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data, {struct obd_device *obd =class_exp2obd (exp);struct ptlrpc_request *req; -int rc; +struct req_format *req_fmt; +int rc; +int saved_rc =0 ; + + + req_fmt = &RQF_MDS_CLOSE ; +if (op_data->op_bias &MDS_HSM_RELEASE ) { + req_fmt = &RQF_MDS_RELEASE_CLOSE ; + +/* allocate a FID for volatile file */ + rc =mdc_fid_alloc (exp, &op_data->op_fid2, op_data); +if (rc <0 ) { +CERROR ("%s: " DFID " failed to allocate FID: %d\n" , + obd->obd_name,PFID (&op_data->op_fid1), rc); +/* save the errcode and proceed to close */ + saved_rc = rc; + } + } *request =NULL ; - req =ptlrpc_request_alloc (class_exp2cliimp (exp), &RQF_MDS_CLOSE ); + req =ptlrpc_request_alloc (class_exp2cliimp (exp), req_fmt);if (req ==NULL )return -ENOMEM ;
@@ -893,7 +910,7 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data, } *request = req;mdc_close_handle_reply (req, op_data, rc); -return rc; +return rc <0 ? rc : saved_rc; } int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
drivers/staging/lustre/lustre/ptlrpc/layout.c +19 -0
@@ -145,6 +145,14 @@ static const struct req_msg_field *mdt_close_client[] = { &RMF_CAPA1 }; +static const struct req_msg_field *mdt_release_close_client[] = { + &RMF_PTLRPC_BODY , + &RMF_MDT_EPOCH , + &RMF_REC_REINT , + &RMF_CAPA1 , + &RMF_CLOSE_DATA +}; +static const struct req_msg_field *obd_statfs_server[] = { &RMF_PTLRPC_BODY , &RMF_OBD_STATFS
@@ -666,6 +674,7 @@ static struct req_format *req_formats[] = { &RQF_MDS_GETXATTR , &RQF_MDS_SYNC , &RQF_MDS_CLOSE , + &RQF_MDS_RELEASE_CLOSE , &RQF_MDS_PIN , &RQF_MDS_UNPIN , &RQF_MDS_READPAGE,
@@ -885,6 +894,11 @@ struct req_msg_field RMF_PTLRPC_BODY = sizeof(struct ptlrpc_body), lustre_swab_ptlrpc_body, NULL);EXPORT_SYMBOL (RMF_PTLRPC_BODY ); +struct req_msg_field RMF_CLOSE_DATA = +DEFINE_MSGF ("data_version" ,0 , +sizeof (struct close_data ), lustre_swab_close_data,NULL ); +EXPORT_SYMBOL (RMF_CLOSE_DATA ); +struct req_msg_field RMF_OBD_STATFS =DEFINE_MSGF ("obd_statfs" ,0 ,sizeof (struct obd_statfs ), lustre_swab_obd_statfs,NULL );
@@ -1412,6 +1426,11 @@ struct req_format RQF_MDS_CLOSE = mdt_close_client, mds_last_unlink_server);EXPORT_SYMBOL (RQF_MDS_CLOSE ); +struct req_format RQF_MDS_RELEASE_CLOSE = +DEFINE_REQ_FMT0 ("MDS_CLOSE" , + mdt_release_close_client, mds_last_unlink_server); +EXPORT_SYMBOL (RQF_MDS_RELEASE_CLOSE ); +struct req_format RQF_MDS_PIN =DEFINE_REQ_FMT0 ("MDS_PIN" , mdt_body_capa, mdt_body_only);
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +7 -0
@@ -2565,3 +2565,10 @@ void lustre_swab_swap_layouts(struct mdc_swap_layouts *msl)__swab64s (&msl->msl_flags); }EXPORT_SYMBOL (lustre_swab_swap_layouts); + +void lustre_swab_close_data (struct close_data *cd) +{ +lustre_swab_lu_fid (&cd->cd_fid); +__swab64s (&cd->cd_data_version); +} +EXPORT_SYMBOL (lustre_swab_close_data);
Signature · 1 line
1.7.9.5