Whamcloud - gitweb
LU-1337 llite: kernel 3.2 protects inode->i_nlink
authorLiu Xuezhao <xuezhao.liu@emc.com>
Tue, 30 Oct 2012 09:01:51 +0000 (17:01 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 20 Nov 2012 23:27:51 +0000 (18:27 -0500)
commit4614c11ecf8d61925b6dd17f1e6f77a4f8450297
treea194c5cdc4b50e3cd2a2bafbb1ab7070e28e4169
parent4d40e3a023bc70e7c32bd50e7d444db076b0576d
LU-1337 llite: kernel 3.2 protects inode->i_nlink

Kernel 3.2 protects inode->i_nlink from direct modification.
Filesystems can only read i_nlink directly and shall use the
(set|clear|inc|drop)_nlink for modification.
See kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb.

This patch adds LC_HAVE_PROTECT_I_NLINK checking and implements
set_nlink for old kernel, clear/inc/drop_nlink exists after 2.6.18

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: Ie958cb308291ecc48d409a1282fed7ea3549a561
Reviewed-on: http://review.whamcloud.com/3577
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/llite/dcache.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/osd-ldiskfs/osd_handler.c