spin_lock(&lli->lli_lock);
if (!list_empty(&llap->llap_pending_write))
list_del_init(&llap->llap_pending_write);
+ if (list_empty(&lli->lli_pending_write_llaps))
+ wake_up(&lli->lli_dirty_wait);
spin_unlock(&lli->lli_lock);
}
spin_lock(&lcq->lcq_lock);
- if (lcq->lcq_list.next == NULL)
- lli = ERR_PTR(-1);
- else if (!list_empty(&lcq->lcq_list)) {
+ /* first, check for queued request. otherwise, we would
+ * leak them upon umount */
+ if (!list_empty(&lcq->lcq_list)) {
lli = list_entry(lcq->lcq_list.next, struct ll_inode_info,
lli_close_item);
list_del_init(&lli->lli_close_item);
+ } else if (lcq->lcq_stop != 0) {
+ lli = ERR_PTR(-1);
}
spin_unlock(&lcq->lcq_lock);
if (lcq == NULL)
return -ENOMEM;
+ lcq->lcq_stop = 0;
spin_lock_init(&lcq->lcq_lock);
INIT_LIST_HEAD(&lcq->lcq_list);
init_waitqueue_head(&lcq->lcq_waitq);
void ll_close_thread_stop(struct ll_close_queue *lcq)
{
init_completion(&lcq->lcq_comp);
- lcq->lcq_list.next = NULL;
+ lcq->lcq_stop = 1;
wake_up(&lcq->lcq_waitq);
wait_for_completion(&lcq->lcq_comp);
OBD_FREE(lcq, sizeof(*lcq));
lli->lli_open_fd_exec_count = 0;
lli->lli_audit_mask = AUDIT_OFF;
lli->lli_key_info = NULL;
+ init_waitqueue_head(&lli->lli_dirty_wait);
}
int ll_fill_super(struct super_block *sb, void *data, int silent)
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
inode->i_generation, inode);
+ LASSERT(ll_is_inode_dirty(inode) == 0);
ll_inode2id(&id, inode);
clear_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &(ll_i2info(inode)->lli_flags));