Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-3963 libcfs: remove last cfs wrappers for cpu node handling
[fs/lustre-release.git]
/
lustre
/
lov
/
lov_io.c
diff --git
a/lustre/lov/lov_io.c
b/lustre/lov/lov_io.c
index
bab17f7
..
bdb8140
100644
(file)
--- a/
lustre/lov/lov_io.c
+++ b/
lustre/lov/lov_io.c
@@
-151,6
+151,9
@@
static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio,
LASSERT(sub->sub_stripe < lio->lis_stripe_count);
ENTRY;
LASSERT(sub->sub_stripe < lio->lis_stripe_count);
ENTRY;
+ if (unlikely(lov_r0(lov)->lo_sub[stripe] == NULL))
+ RETURN(-EIO);
+
result = 0;
sub->sub_io_initialized = 0;
sub->sub_borrowed = 0;
result = 0;
sub->sub_io_initialized = 0;
sub->sub_borrowed = 0;
@@
-248,16
+251,14
@@
void lov_sub_put(struct lov_io_sub *sub)
int lov_page_stripe(const struct cl_page *page)
{
int lov_page_stripe(const struct cl_page *page)
{
- struct lovsub_object *subobj;
const struct cl_page_slice *slice;
ENTRY;
const struct cl_page_slice *slice;
ENTRY;
- slice = cl_page_at(page, &lov
sub
_device_type);
+ slice = cl_page_at(page, &lov_device_type);
LASSERT(slice != NULL);
LASSERT(slice->cpl_obj != NULL);
LASSERT(slice != NULL);
LASSERT(slice->cpl_obj != NULL);
- subobj = cl2lovsub(slice->cpl_obj);
- RETURN(subobj->lso_index);
+ RETURN(cl2lov_page(slice)->lps_stripe);
}
struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
}
struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
@@
-304,8
+305,8
@@
static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio,
RETURN(result);
}
RETURN(result);
}
-static
void
lov_io_slice_init(struct lov_io *lio,
-
struct lov_object *obj, struct cl_io *io)
+static
int
lov_io_slice_init(struct lov_io *lio,
+ struct lov_object *obj, struct cl_io *io)
{
ENTRY;
{
ENTRY;
@@
-323,6
+324,13
@@
static void lov_io_slice_init(struct lov_io *lio,
lio->lis_io_endpos = lio->lis_endpos;
if (cl_io_is_append(io)) {
LASSERT(io->ci_type == CIT_WRITE);
lio->lis_io_endpos = lio->lis_endpos;
if (cl_io_is_append(io)) {
LASSERT(io->ci_type == CIT_WRITE);
+
+ /* If there is LOV EA hole, then we may cannot locate
+ * the current file-tail exactly. */
+ if (unlikely(obj->lo_lsm->lsm_pattern &
+ LOV_PATTERN_F_HOLE))
+ RETURN(-EIO);
+
lio->lis_pos = 0;
lio->lis_endpos = OBD_OBJECT_EOF;
}
lio->lis_pos = 0;
lio->lis_endpos = OBD_OBJECT_EOF;
}
@@
-358,7
+366,7
@@
static void lov_io_slice_init(struct lov_io *lio,
LBUG();
}
LBUG();
}
-
EXIT
;
+
RETURN(0)
;
}
static void lov_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
}
static void lov_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
@@
-408,6
+416,15
@@
static int lov_io_iter_init(const struct lu_env *env,
endpos, &start, &end))
continue;
endpos, &start, &end))
continue;
+ if (unlikely(lov_r0(lio->lis_object)->lo_sub[stripe] == NULL)) {
+ if (ios->cis_io->ci_type == CIT_READ ||
+ ios->cis_io->ci_type == CIT_WRITE ||
+ ios->cis_io->ci_type == CIT_FAULT)
+ RETURN(-EIO);
+
+ continue;
+ }
+
end = lov_offset_mod(end, +1);
sub = lov_sub_get(env, lio, stripe);
if (!IS_ERR(sub)) {
end = lov_offset_mod(end, +1);
sub = lov_sub_get(env, lio, stripe);
if (!IS_ERR(sub)) {
@@
-421,7
+438,7
@@
static int lov_io_iter_init(const struct lu_env *env,
rc = PTR_ERR(sub);
if (!rc)
rc = PTR_ERR(sub);
if (!rc)
-
cfs_
list_add_tail(&sub->sub_linkage, &lio->lis_active);
+ list_add_tail(&sub->sub_linkage, &lio->lis_active);
else
break;
}
else
break;
}
@@
-473,7
+490,7
@@
static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
int rc = 0;
ENTRY;
int rc = 0;
ENTRY;
-
cfs_
list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
+ list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
lov_sub_enter(sub);
rc = iofunc(sub->sub_env, sub->sub_io);
lov_sub_exit(sub);
lov_sub_enter(sub);
rc = iofunc(sub->sub_env, sub->sub_io);
lov_sub_exit(sub);
@@
-542,8
+559,8
@@
static void lov_io_iter_fini(const struct lu_env *env,
ENTRY;
rc = lov_io_call(env, lio, lov_io_iter_fini_wrapper);
LASSERT(rc == 0);
ENTRY;
rc = lov_io_call(env, lio, lov_io_iter_fini_wrapper);
LASSERT(rc == 0);
-
while (!cfs_
list_empty(&lio->lis_active))
-
cfs_
list_del_init(lio->lis_active.next);
+
while (!
list_empty(&lio->lis_active))
+ list_del_init(lio->lis_active.next);
EXIT;
}
EXIT;
}
@@
-742,7
+759,7
@@
static void lov_io_fsync_end(const struct lu_env *env,
ENTRY;
*written = 0;
ENTRY;
*written = 0;
-
cfs_
list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
+ list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
struct cl_io *subio = sub->sub_io;
lov_sub_enter(sub);
struct cl_io *subio = sub->sub_io;
lov_sub_enter(sub);
@@
-889,7
+906,10
@@
int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
ENTRY;
INIT_LIST_HEAD(&lio->lis_active);
ENTRY;
INIT_LIST_HEAD(&lio->lis_active);
- lov_io_slice_init(lio, lov, io);
+ io->ci_result = lov_io_slice_init(lio, lov, io);
+ if (io->ci_result != 0)
+ RETURN(io->ci_result);
+
if (io->ci_result == 0) {
io->ci_result = lov_io_subio_init(env, lio, io);
if (io->ci_result == 0) {
if (io->ci_result == 0) {
io->ci_result = lov_io_subio_init(env, lio, io);
if (io->ci_result == 0) {