Whamcloud - gitweb
LU-481 Don't store 'transient' page in radix tree
authorNiu Yawei <niu@whamcloud.com>
Fri, 8 Jul 2011 06:44:00 +0000 (23:44 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 13 Jul 2011 17:28:07 +0000 (10:28 -0700)
commit9e213f7975423b69eae06b1e561516e6b26a2c72
tree2f801a1b78ad354a336b3fccb4c9b1fdbfe3332e
parenta2cccb1f89f6f7b9b152e227b9e0574c45708019
LU-481 Don't store 'transient' page in radix tree

- We currently store both 'transient' page and inode page in the
  same radix tree, which will cause trouble for the race handling
  of concurrent dio and buffered read, imagine the following case:

  dio created a 'transient' page for a given file offset in the
  radix tree, while a concurrent buffered read on the same offset
  happened, the reader will try to find the exsting cached page by
  searching the radix tree, however, the 'transient' page is found,
  and the read will fail for -EBUSY at the end.

  To make the situation worse, there are two level of radix trees for
  a give file page (object and sub-object), above race can happen
  in both levels and we have to make sure page type consistence
  between these two levels.

  Actually, it doesn't make sense to store these disposable 'transient'
  page in the radix tree, so we just remove them in this patch.

- In cl_page_alloc(), if the coo_page_init() fails, we should call
  cl_page_delete0() to break the linkage between vmpage and cl_page
  before calling cl_page_free().

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: If2fa85495e6e78b330571b3348ac55a7796a4a9f
Reviewed-on: http://review.whamcloud.com/1072
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_page.c
lustre/obdclass/cl_page.c