* [PATCH] sheepdog: fix to update data_vdi_id after writing data object
@ 2015-05-13 1:06 Teruaki Ishizaki
2015-05-13 1:41 ` Hitoshi Mitake
0 siblings, 1 reply; 2+ messages in thread
From: Teruaki Ishizaki @ 2015-05-13 1:06 UTC (permalink / raw)
To: stgt, mitake.hitoshi; +Cc: Teruaki Ishizaki
Previously data_vdi_id was updated although data object was not
written successfully.
That broke inode data and volume data.
This patch changes to update data_vdi_id after writing data
object successfully.
Signed-off-by: Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
---
usr/bs_sheepdog.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/usr/bs_sheepdog.c b/usr/bs_sheepdog.c
index 9b5b259..cfaf48b 100644
--- a/usr/bs_sheepdog.c
+++ b/usr/bs_sheepdog.c
@@ -937,14 +937,6 @@ retry:
oid = vid_to_data_oid(ai->inode.vdi_id, idx);
- ai->min_dirty_data_idx =
- min_t(uint32_t,
- idx, ai->min_dirty_data_idx);
- ai->max_dirty_data_idx =
- max_t(uint32_t,
- idx, ai->max_dirty_data_idx);
-
- ai->inode.data_vdi_id[idx] = vid;
}
need_reload_inode = 0;
@@ -966,6 +958,14 @@ retry:
}
if (create) {
+ ai->min_dirty_data_idx =
+ min_t(uint32_t, idx,
+ ai->min_dirty_data_idx);
+ ai->max_dirty_data_idx =
+ max_t(uint32_t, idx,
+ ai->max_dirty_data_idx);
+ ai->inode.data_vdi_id[idx] = vid;
+
need_update_inode = 1;
create = 0;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sheepdog: fix to update data_vdi_id after writing data object
2015-05-13 1:06 [PATCH] sheepdog: fix to update data_vdi_id after writing data object Teruaki Ishizaki
@ 2015-05-13 1:41 ` Hitoshi Mitake
0 siblings, 0 replies; 2+ messages in thread
From: Hitoshi Mitake @ 2015-05-13 1:41 UTC (permalink / raw)
To: Teruaki Ishizaki; +Cc: stgt, mitake.hitoshi
At Wed, 13 May 2015 10:06:32 +0900,
Teruaki Ishizaki wrote:
>
> Previously data_vdi_id was updated although data object was not
> written successfully.
> That broke inode data and volume data.
>
> This patch changes to update data_vdi_id after writing data
> object successfully.
>
> Signed-off-by: Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
> ---
> usr/bs_sheepdog.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
Looks good to me.
Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Thanks,
Hitoshi
>
> diff --git a/usr/bs_sheepdog.c b/usr/bs_sheepdog.c
> index 9b5b259..cfaf48b 100644
> --- a/usr/bs_sheepdog.c
> +++ b/usr/bs_sheepdog.c
> @@ -937,14 +937,6 @@ retry:
>
> oid = vid_to_data_oid(ai->inode.vdi_id, idx);
>
> - ai->min_dirty_data_idx =
> - min_t(uint32_t,
> - idx, ai->min_dirty_data_idx);
> - ai->max_dirty_data_idx =
> - max_t(uint32_t,
> - idx, ai->max_dirty_data_idx);
> -
> - ai->inode.data_vdi_id[idx] = vid;
> }
>
> need_reload_inode = 0;
> @@ -966,6 +958,14 @@ retry:
> }
>
> if (create) {
> + ai->min_dirty_data_idx =
> + min_t(uint32_t, idx,
> + ai->min_dirty_data_idx);
> + ai->max_dirty_data_idx =
> + max_t(uint32_t, idx,
> + ai->max_dirty_data_idx);
> + ai->inode.data_vdi_id[idx] = vid;
> +
> need_update_inode = 1;
> create = 0;
> }
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe stgt" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-13 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 1:06 [PATCH] sheepdog: fix to update data_vdi_id after writing data object Teruaki Ishizaki
2015-05-13 1:41 ` Hitoshi Mitake
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.