For async-write on block device,if device removed,but the vfs don't know it.
It will continue to do.
Patch1 set size of inode of block device to zero when removed disk.By this,vfs 
know 
disk changed.
Path2 add size-check on blk_aio_write.If pos of write larger than size of 
inode,it will
return zero.So the user can check disk state.

V2:
patch1:
      -consider the case which disk has partitions
      -move i_size_write into func invalidate_partition
patch2: No change

Jianpeng Ma (2):
  block: Set inode of block_device size to zero when delete gendisk.
  block_dev: Add size check before doing async write on block device.

 block/genhd.c | 6 ++++++
 fs/block_dev.c |  4 ++++
 2 files changed, 10 insertions(+)

-- 
1.8.4-rc0N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü¨}©ž²Æ 
zÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ߢf”ù^jÇ«y§m…á@A«a¶Úÿ
0¶ìh®å’i

Reply via email to