Originally, the osd_device::od_dirent_journal was a bit variable,
changing such variable can happen when other is changing other bit
that is in the same integer in parallel. Because there is no lock
protection when change the bits, one thread changing may overwrite
others. So split the osd_device::od_dirent_journal as independent
variable.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I859932290ebf3b94be4f588f8e3e9635fe204d49
Reviewed-on: http://review.whamcloud.com/13311
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
osd_dto_credits_noquota[DTO_INDEX_INSERT] + 1 + 1 + 2;
again:
osd_dto_credits_noquota[DTO_INDEX_INSERT] + 1 + 1 + 2;
again:
- if (dev->od_dirent_journal) {
+ if (dev->od_dirent_journal != 0) {
jh = osd_journal_start_sb(sb, LDISKFS_HT_MISC, credits);
if (IS_ERR(jh)) {
rc = PTR_ERR(jh);
jh = osd_journal_start_sb(sb, LDISKFS_HT_MISC, credits);
if (IS_ERR(jh)) {
rc = PTR_ERR(jh);
GOTO(out_inode, rc = 0);
}
GOTO(out_inode, rc = 0);
}
- if (!dev->od_dirent_journal) {
+ if (dev->od_dirent_journal == 0) {
iput(inode);
brelse(bh);
if (hlock != NULL)
iput(inode);
brelse(bh);
if (hlock != NULL)
GOTO(out_inode, rc = 0);
}
GOTO(out_inode, rc = 0);
}
- if (!dev->od_dirent_journal) {
+ if (dev->od_dirent_journal == 0) {
iput(inode);
brelse(bh);
if (hlock != NULL)
iput(inode);
brelse(bh);
if (hlock != NULL)
GOTO(out_inode, rc = 0);
}
GOTO(out_inode, rc = 0);
}
- if (!dev->od_dirent_journal) {
+ if (dev->od_dirent_journal == 0) {
iput(inode);
brelse(bh);
if (hlock != NULL)
iput(inode);
brelse(bh);
if (hlock != NULL)
if (hlock != NULL) {
ldiskfs_htree_unlock(hlock);
} else {
if (hlock != NULL) {
ldiskfs_htree_unlock(hlock);
} else {
- if (dev->od_dirent_journal)
+ if (dev->od_dirent_journal != 0)
up_write(&obj->oo_ext_idx_sem);
else
up_read(&obj->oo_ext_idx_sem);
up_write(&obj->oo_ext_idx_sem);
else
up_read(&obj->oo_ext_idx_sem);
unsigned int od_fl_capa:1,
od_maybe_new:1,
od_noscrub:1,
unsigned int od_fl_capa:1,
od_maybe_new:1,
od_noscrub:1,
od_igif_inoi:1,
od_check_ff:1,
od_is_ost:1,
od_lma_self_repair:1;
od_igif_inoi:1,
od_check_ff:1,
od_is_ost:1,
od_lma_self_repair:1;
- unsigned long od_capa_timeout;
- __u32 od_capa_alg;
- struct lustre_capa_key *od_capa_keys;
+ unsigned long od_capa_timeout;
+ __u32 od_capa_alg;
+ __u32 od_dirent_journal;
+ struct lustre_capa_key *od_capa_keys;
struct hlist_head *od_capa_hash;
struct proc_dir_entry *od_proc_entry;
struct hlist_head *od_capa_hash;
struct proc_dir_entry *od_proc_entry;
- struct lprocfs_stats *od_stats;
+ struct lprocfs_stats *od_stats;