[sheepdog] [sheepdog/sheepdog] 245abd: sheep: Check shared lock state even if VDI is snap...

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Sep 6 03:05:29 CEST 2016


  Branch: refs/heads/master
  Home:   https://github.com/sheepdog/sheepdog
  Commit: 245abd6e3e8956ba736c712a3ad21c45402ff48c
      https://github.com/sheepdog/sheepdog/commit/245abd6e3e8956ba736c712a3ad21c45402ff48c
  Author: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>
  Date:   2016-09-05 (Mon, 05 Sep 2016)

  Changed paths:
    M sheep/vdi.c

  Log Message:
  -----------
  sheep: Check shared lock state even if VDI is snapshot

This is for iSCSI multipath usage with tgtd.

When sheep receives SD_READ_OBJ request from tgtd, the function
is_refresh_required is called. When it returns true, the tgtd reloads
the inode object of the target VDI.

In the current sheep implementation, is_refresh_required returns false
if the target VDI is snapshot. This lets tgtd not reload the inode object
then leads to inode inconsistency between tgtd when all of the following
conditions are met:

  * iSCSI multipath is configured (1-active and N-standby)
  * a non-snapshot VDI is set as a new LUN of tgtd
  * a snapshot of the VDI above is taken
  * active path switched after the snapshot is taken
  * tgtd sends SD_READ_OBJ after the active path switched

Also, the function validate_myself has a similar issue.

This commit fixed the problems described above. After the fix, sheep treats
snapshot and non-snapshot VDI in the same way i.e. checks its shared lock
state.

Signed-off-by: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>


  Commit: 3373df269e9ac2d26344296f99bf00e09de67de7
      https://github.com/sheepdog/sheepdog/commit/3373df269e9ac2d26344296f99bf00e09de67de7
  Author: Hitoshi Mitake <mitake.hitoshi at gmail.com>
  Date:   2016-09-06 (Tue, 06 Sep 2016)

  Changed paths:
    M sheep/vdi.c

  Log Message:
  -----------
  Merge pull request #306 from tmenjo/fix-is-refresh-required

sheep: Check shared lock state even if VDI is snapshot


Compare: https://github.com/sheepdog/sheepdog/compare/dbf83bcaee9a...3373df269e9a


More information about the sheepdog mailing list