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-17034 quota: lqeg_arr memmory corruption
[fs/lustre-release.git]
/
lustre
/
obdclass
/
lu_tgt_pool.c
diff --git
a/lustre/obdclass/lu_tgt_pool.c
b/lustre/obdclass/lu_tgt_pool.c
index
4bf0d16
..
7ef83ce
100644
(file)
--- a/
lustre/obdclass/lu_tgt_pool.c
+++ b/
lustre/obdclass/lu_tgt_pool.c
@@
-132,13
+132,15
@@
EXPORT_SYMBOL(lu_tgt_pool_extend);
* \retval 0 if target could be added to the pool
* \retval negative error if target \a idx was not added
*/
* \retval 0 if target could be added to the pool
* \retval negative error if target \a idx was not added
*/
-int lu_tgt_pool_add(struct lu_tgt_pool *op, __u32 idx, unsigned int min_count)
+int lu_tgt_pool_add_lock(struct lu_tgt_pool *op, __u32 idx,
+ unsigned int min_count, bool lock)
{
unsigned int i;
int rc = 0;
ENTRY;
{
unsigned int i;
int rc = 0;
ENTRY;
- down_write(&op->op_rw_sem);
+ if (lock)
+ down_write(&op->op_rw_sem);
/* search ost in pool array */
for (i = 0; i < op->op_count; i++) {
/* search ost in pool array */
for (i = 0; i < op->op_count; i++) {
@@
-155,10
+157,11
@@
int lu_tgt_pool_add(struct lu_tgt_pool *op, __u32 idx, unsigned int min_count)
op->op_count++;
EXIT;
out:
op->op_count++;
EXIT;
out:
- up_write(&op->op_rw_sem);
+ if (lock)
+ up_write(&op->op_rw_sem);
return rc;
}
return rc;
}
-EXPORT_SYMBOL(lu_tgt_pool_add);
+EXPORT_SYMBOL(lu_tgt_pool_add
_lock
);
/**
* Remove an existing pool from the system.
/**
* Remove an existing pool from the system.