Whamcloud - gitweb
LU-7925 llite: avoid clearing i_nlink for inodes in use 64/19164/4
authorAndrew Perepechko <andrew.perepechko@seagate.com>
Sat, 26 Mar 2016 14:48:25 +0000 (17:48 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Apr 2016 03:22:05 +0000 (03:22 +0000)
commite6b7abc567ee0a8085e440c91e102d4318575529
treeb0110ef08652d8fa27b53e311b195dda5db8e77e
parent8e80b8f52d88ddadb448b933813a43fcc96eccd9
LU-7925 llite: avoid clearing i_nlink for inodes in use

The patch removes find_cbdata callbacks and clear_nlink
from dentry_iput path, since this piece of code makes
a few races possible.

The test case reproduces one of the possible races
described in LU-7925:

1) two hard links are created for the same file
2) the test calls stat(2) for link #1
3) in the middle of 2) the test opens and closes link #2
4) in the middle of 2) the test drops the ldlm locks and
   forces dentry reclaim via vm.drop_caches=2
5) in the middle of 2) ll_d_iput() clears i_nlink for
   the inode
6) the initial stat(2) continues and copies the wrong
   i_nlink value into st_nlink

Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Seagate-bug-id: MRP-3271
Change-Id: I185bed4b875a4fbf66df835cf9161912a6ade415
Reviewed-on: http://review.whamcloud.com/19164
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Wally Wang <wang@cray.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
15 files changed:
lustre/include/cl_object.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/include/obd_support.h
lustre/llite/dcache.c
lustre/llite/file.c
lustre/lmv/lmv_obd.c
lustre/lov/lov_object.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_request.c
lustre/obdclass/cl_object.c
lustre/obdclass/lprocfs_status.c
lustre/osc/osc_object.c
lustre/tests/sanity.sh