Whamcloud - gitweb
LU-5507 recovery: don't replay closed open 67/12667/4
authorNiu Yawei <yawei.niu@intel.com>
Tue, 11 Nov 2014 05:54:34 +0000 (00:54 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 3 Dec 2014 02:25:12 +0000 (02:25 +0000)
commitcfbfcc6ad9ebb5893be2d1e85fc959794fd914ed
tree3c299d7db4d0d15bf2308e711b763093d9073c16
parentd24d8186ffb1aad3a4286e2fbda63f79e90eb104
LU-5507 recovery: don't replay closed open

To avoid scanning the replay open list every time in the
ptlrpc_free_committed(), the fix of LU-2613 (4322e0f9) changed
the ptlrpc_free_committed() to skip the open list unless the
import generation is changed. That introduced a race which could
make a closed open being replayed:

1. Application calls ll_close_inode_openhandle()-> mdc_close(),
   to close file, rq_replay is cleared, but the open request is
   still on the imp_committed_list;

2. Before the md_clear_open_replay_data() is called for close,
   client start replay, and that closed open will be replayed
   mistakenly;

3. Open replay interpret callback (mdc_replay_open) could race
   with the mdc_clear_open_replay_data() at the end;

This patch fix the ptlrpc_free_committed() to make sure the
open list is scanned on recovery to prevent the closed open request
from being replayed.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Ia67fe5d8d501a69bafbbd7e44bd612abb9c254c6
Reviewed-on: http://review.whamcloud.com/12667
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/client.c