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-7336 ofd: cleanup proc when ofd_info_init fails
[fs/lustre-release.git]
/
lustre
/
mdt
/
mdt_hsm_cdt_requests.c
diff --git
a/lustre/mdt/mdt_hsm_cdt_requests.c
b/lustre/mdt/mdt_hsm_cdt_requests.c
index
796cbea
..
bbd7f44
100644
(file)
--- a/
lustre/mdt/mdt_hsm_cdt_requests.c
+++ b/
lustre/mdt/mdt_hsm_cdt_requests.c
@@
-23,6
+23,7
@@
* (C) Copyright 2012 Commissariat a l'energie atomique et aux energies
* alternatives
*
* (C) Copyright 2012 Commissariat a l'energie atomique et aux energies
* alternatives
*
+ * Copyright (c) 2014, Intel Corporation.
*/
/*
* lustre/mdt/mdt_hsm_cdt_requests.c
*/
/*
* lustre/mdt/mdt_hsm_cdt_requests.c
@@
-156,8
+157,13
@@
static int hsm_update_work(struct cdt_req_progress *crp,
int rc, osz, nsz;
struct interval_node **new_vv;
struct interval_node *v, *node;
int rc, osz, nsz;
struct interval_node **new_vv;
struct interval_node *v, *node;
+ __u64 end;
ENTRY;
ENTRY;
+ end = extent->offset + extent->length;
+ if (end <= extent->offset)
+ RETURN(-EINVAL);
+
mutex_lock(&crp->crp_lock);
/* new node index */
mutex_lock(&crp->crp_lock);
/* new node index */
@@
-196,7
+202,7
@@
static int hsm_update_work(struct cdt_req_progress *crp,
v = crp->crp_node[crp->crp_cnt / NODE_VECTOR_SZ];
node = &v[crp->crp_cnt % NODE_VECTOR_SZ];
v = crp->crp_node[crp->crp_cnt / NODE_VECTOR_SZ];
node = &v[crp->crp_cnt % NODE_VECTOR_SZ];
- interval_set(node, extent->offset, e
xtent->offset + extent->length
);
+ interval_set(node, extent->offset, e
nd
);
/* try to insert, if entry already exist ignore the new one
* it can happen if ct sends 2 times the same progress */
if (interval_insert(node, &crp->crp_root) == NULL)
/* try to insert, if entry already exist ignore the new one
* it can happen if ct sends 2 times the same progress */
if (interval_insert(node, &crp->crp_root) == NULL)
@@
-205,7
+211,7
@@
static int hsm_update_work(struct cdt_req_progress *crp,
rc = 0;
out:
mutex_unlock(&crp->crp_lock);
rc = 0;
out:
mutex_unlock(&crp->crp_lock);
-
return rc
;
+
RETURN(rc)
;
}
/**
}
/**
@@
-219,7
+225,7
@@
static void mdt_cdt_init_request_tree(struct cdt_req_progress *crp)
crp->crp_max = 0;
}
crp->crp_max = 0;
}
-/** Allocate/init a agent request and its sub-structures.
+/** Allocate/init a
n
agent request and its sub-structures.
*
* \param compound_id [IN]
* \param archive_id [IN]
*
* \param compound_id [IN]
* \param archive_id [IN]
@@
-260,7
+266,7
@@
struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id,
}
/**
}
/**
- * Free a agent request and its sub-structures.
+ * Free a
n
agent request and its sub-structures.
*
* \param car [IN] Request to be freed.
*/
*
* \param car [IN] Request to be freed.
*/
@@
-294,7
+300,7
@@
void mdt_cdt_put_request(struct cdt_agent_req *car)
/**
* find request in the list by cookie or by fid
/**
* find request in the list by cookie or by fid
- * lock cdt_request_lock needs to be h
o
ld by caller
+ * lock cdt_request_lock needs to be h
e
ld by caller
* \param cdt [IN] coordinator
* \param cookie [IN] request cookie
* \param fid [IN] fid
* \param cdt [IN] coordinator
* \param cookie [IN] request cookie
* \param fid [IN] fid
@@
-521,7
+527,7
@@
static int mdt_hsm_active_requests_proc_show(struct seq_file *s, void *v)
" compound/cookie="LPX64"/"LPX64
" action=%s archive#=%d flags="LPX64
" extent="LPX64"-"LPX64" gid="LPX64
" compound/cookie="LPX64"/"LPX64
" action=%s archive#=%d flags="LPX64
" extent="LPX64"-"LPX64" gid="LPX64
- " data=[%s] canceled=%d uuid=%s done="LPU64"
%%
\n",
+ " data=[%s] canceled=%d uuid=%s done="LPU64"\n",
PFID(&car->car_hai->hai_fid),
PFID(&car->car_hai->hai_dfid),
car->car_compound_id, car->car_hai->hai_cookie,
PFID(&car->car_hai->hai_fid),
PFID(&car->car_hai->hai_dfid),
car->car_compound_id, car->car_hai->hai_cookie,
@@
-569,15
+575,12
@@
static int lprocfs_open_hsm_active_requests(struct inode *inode,
int rc;
ENTRY;
int rc;
ENTRY;
- if (LPROCFS_ENTRY_CHECK(PDE(inode)))
- RETURN(-ENOENT);
-
rc = seq_open(file, &mdt_hsm_active_requests_proc_ops);
if (rc) {
RETURN(rc);
}
s = file->private_data;
rc = seq_open(file, &mdt_hsm_active_requests_proc_ops);
if (rc) {
RETURN(rc);
}
s = file->private_data;
- s->private = PDE
(inode)->data
;
+ s->private = PDE
_DATA(inode)
;
RETURN(rc);
}
RETURN(rc);
}