From: Peng Tao <bergwolf@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Fan Yong <fan.yong@intel.com>,
Peng Tao <bergwolf@gmail.com>,
Andreas Dilger <andreas.dilger@intel.com>
Subject: [PATCH 09/16] staging/lustre/scrub: OI scrub on OST
Date: Tue, 26 Nov 2013 10:05:03 +0800 [thread overview]
Message-ID: <1385431510-18988-10-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1385431510-18988-1-git-send-email-bergwolf@gmail.com>
From: Fan Yong <fan.yong@intel.com>
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
Signed-off-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
---
.../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(-)
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 7dfb925..e4cb1ad 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -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.
*/
diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index 825a0c9..1748985 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -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
diff --git a/drivers/staging/lustre/lustre/obdclass/md_attrs.c b/drivers/staging/lustre/lustre/obdclass/md_attrs.c
index f718782..91eb30b 100644
--- a/drivers/staging/lustre/lustre/obdclass/md_attrs.c
+++ b/drivers/staging/lustre/lustre/obdclass/md_attrs.c
@@ -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;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index e3f02c7..7160a23 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -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",
--
1.7.9.5
next prev parent reply other threads:[~2013-11-26 2:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 2:04 [PATCH 00/16] staging/lustre: sync with external tree, set 2 Peng Tao
2013-11-26 2:04 ` [PATCH 01/16] staging/lustre/server: use unified request handler for MGS Peng Tao
2013-11-26 2:04 ` [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs Peng Tao
2013-11-26 3:14 ` Greg Kroah-Hartman
2013-11-26 3:25 ` Peng Tao
2013-11-26 3:34 ` Greg Kroah-Hartman
2013-11-26 4:05 ` Peng Tao
2013-11-26 2:04 ` [PATCH 03/16] staging/lustre/nfs: writing to new files will return ENOENT Peng Tao
2013-11-26 6:45 ` Patrick Farrell
2013-11-26 14:09 ` Peng Tao
2013-11-26 2:04 ` [PATCH 04/16] staging/lustre/ptlrpc: Fix race during exp_flock_hash creation Peng Tao
2013-11-26 2:04 ` [PATCH 05/16] staging/lustre/mdc: prevent fall through in mdc_iocontrol() Peng Tao
2013-11-26 2:05 ` [PATCH 06/16] staging/lustre/lu: shrink lu_object by 8 bytes on x86_64 Peng Tao
2013-11-26 2:05 ` [PATCH 07/16] staging/lustre/mdt: HSM coordinator client interface Peng Tao
2013-11-26 2:05 ` [PATCH 08/16] staging/lustre/mdt: HSM coordinator agent interface Peng Tao
2013-11-26 3:30 ` Greg Kroah-Hartman
2013-11-26 4:09 ` Peng Tao
2013-11-26 2:05 ` Peng Tao [this message]
2013-11-26 2:05 ` [PATCH 10/16] staging/lustre/scrub: control OI scrub on OST from user space Peng Tao
2013-11-26 2:05 ` [PATCH 11/16] staging/lustre/llite: don't check for O_CREAT in it_create_mode Peng Tao
2013-11-26 2:05 ` [PATCH 12/16] staging/lustre/build: clean up unused variables and dead code Peng Tao
2013-11-26 2:05 ` [PATCH 13/16] staging/lustre/build: fix compilation issue with is_compat_task Peng Tao
2013-11-26 2:05 ` [PATCH 14/16] staging/lustre/ptlrpc: Fix a crash when dereferencing NULL pointer Peng Tao
2013-11-26 2:05 ` [PATCH 15/16] staging/lustre/hsm: Add hsm_release feature Peng Tao
2013-11-26 2:05 ` [PATCH] staging/lustre/llite: extended attribute cache Peng Tao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385431510-18988-10-git-send-email-bergwolf@gmail.com \
--to=bergwolf@gmail.com \
--cc=andreas.dilger@intel.com \
--cc=fan.yong@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox