From: vitaly Date: Tue, 19 Sep 2006 21:51:58 +0000 (+0000) Subject: Branch b_new_cmd X-Git-Tag: v1_8_0_110~486^2~898 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=de900dafbb46f528780075596156b41c0226cc54;p=fs%2Flustre-release.git Branch b_new_cmd b=22564 perform done_write for pending inodes on shutdown mark inode as having attributes changed on sync write. --- diff --git a/lustre/llite/llite_close.c b/lustre/llite/llite_close.c index 80e6508..f49b21f 100644 --- a/lustre/llite/llite_close.c +++ b/lustre/llite/llite_close.c @@ -217,13 +217,12 @@ static struct ll_inode_info *ll_close_next_lli(struct ll_close_queue *lcq) spin_lock(&lcq->lcq_lock); - if (lcq->lcq_head.next == NULL) - lli = ERR_PTR(-1); - else if (!list_empty(&lcq->lcq_head)) { + if (!list_empty(&lcq->lcq_head)) { lli = list_entry(lcq->lcq_head.next, struct ll_inode_info, lli_close_list); list_del_init(&lli->lli_close_list); - } + } else if (atomic_read(&lcq->lcq_stop)) + lli = ERR_PTR(-1); spin_unlock(&lcq->lcq_lock); return lli; @@ -290,7 +289,7 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret) void ll_close_thread_shutdown(struct ll_close_queue *lcq) { init_completion(&lcq->lcq_comp); - lcq->lcq_head.next = NULL; + atomic_inc(&lcq->lcq_stop); wake_up(&lcq->lcq_waitq); wait_for_completion(&lcq->lcq_comp); OBD_FREE(lcq, sizeof(*lcq)); diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 83f976f..54c5c07 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -573,6 +573,7 @@ struct ll_close_queue { struct list_head lcq_head; wait_queue_head_t lcq_waitq; struct completion lcq_comp; + atomic_t lcq_stop; }; void llap_write_pending(struct inode *inode, struct ll_async_page *llap); diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index e74eeab..38dfca5 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -658,7 +658,9 @@ static int queue_or_sync_write(struct obd_export *exp, struct inode *inode, } llap->llap_write_queued = 0; - + /* Do not pass llap here as it is sync write. */ + llap_write_pending(inode, NULL); + rc = oig_init(&oig); if (rc) GOTO(out, rc); diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index e7e3c79..aec45f2 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -155,7 +155,7 @@ int mdt_attr_set(struct mdt_thread_info *info, struct mdt_object *mo, int flags) * skip setattr. */ next = mdt_object_child(mo); if (som_update && (info->mti_epoch->ioepoch != mo->mot_ioepoch)) - GOTO(out, rc = 0); + GOTO(out, rc = 0); next = mdt_object_child(mo); if (lu_object_assert_not_exists(&mo->mot_obj.mo_lu))