lti_local_iov is used to store iovec in case of 1 segment.
It is needed to hold reference on lu_env during
call of ll_file_write_iter() or ll_file_read_iter().
Otherwise an assertion fails:
vvp_io_update_iov()) ASSERTION( vio->vui_tot_nrsegs >= vio->vui_iter->nr_segs ) failed
Change-Id: Iaff4c81c6ced9ac0e1557dd0eb1fab5205b48e28
Signed-off-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Reviewed-on: http://review.whamcloud.com/17632
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
struct iov_iter *to;
size_t iov_count;
ssize_t result;
struct iov_iter *to;
size_t iov_count;
ssize_t result;
+ struct lu_env *env = NULL;
+ __u16 refcheck;
ENTRY;
result = ll_file_get_iov_count(iov, &nr_segs, &iov_count);
ENTRY;
result = ll_file_get_iov_count(iov, &nr_segs, &iov_count);
RETURN(result);
if (nr_segs == 1) {
RETURN(result);
if (nr_segs == 1) {
- struct lu_env *env;
- __u16 refcheck;
env = cl_env_get(&refcheck);
if (IS_ERR(env))
env = cl_env_get(&refcheck);
if (IS_ERR(env))
local_iov = &ll_env_info(env)->lti_local_iov;
*local_iov = *iov;
local_iov = &ll_env_info(env)->lti_local_iov;
*local_iov = *iov;
- cl_env_put(env, &refcheck);
} else {
OBD_ALLOC(local_iov, sizeof(*iov) * nr_segs);
if (local_iov == NULL)
} else {
OBD_ALLOC(local_iov, sizeof(*iov) * nr_segs);
if (local_iov == NULL)
+ if (nr_segs == 1)
+ cl_env_put(env, &refcheck);
+ else
OBD_FREE(local_iov, sizeof(*iov) * nr_segs);
RETURN(result);
OBD_FREE(local_iov, sizeof(*iov) * nr_segs);
RETURN(result);
struct iov_iter *from;
size_t iov_count;
ssize_t result;
struct iov_iter *from;
size_t iov_count;
ssize_t result;
+ struct lu_env *env = NULL;
+ __u16 refcheck;
ENTRY;
result = ll_file_get_iov_count(iov, &nr_segs, &iov_count);
ENTRY;
result = ll_file_get_iov_count(iov, &nr_segs, &iov_count);
RETURN(result);
if (nr_segs == 1) {
RETURN(result);
if (nr_segs == 1) {
- struct lu_env *env;
- __u16 refcheck;
-
env = cl_env_get(&refcheck);
if (IS_ERR(env))
RETURN(PTR_ERR(env));
local_iov = &ll_env_info(env)->lti_local_iov;
*local_iov = *iov;
env = cl_env_get(&refcheck);
if (IS_ERR(env))
RETURN(PTR_ERR(env));
local_iov = &ll_env_info(env)->lti_local_iov;
*local_iov = *iov;
-
- cl_env_put(env, &refcheck);
} else {
OBD_ALLOC(local_iov, sizeof(*iov) * nr_segs);
if (local_iov == NULL)
} else {
OBD_ALLOC(local_iov, sizeof(*iov) * nr_segs);
if (local_iov == NULL)
+ if (nr_segs == 1)
+ cl_env_put(env, &refcheck);
+ else
OBD_FREE(local_iov, sizeof(*iov) * nr_segs);
RETURN(result);
OBD_FREE(local_iov, sizeof(*iov) * nr_segs);
RETURN(result);