From: Linus Torvalds Date: Wed, 2 Nov 2011 18:41:01 +0000 (-0700) Subject: Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs... X-Git-Tag: v3.2-rc1~84 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=d211858837ff8d8e31942ca7d27e6e08b3b46f5e Merge branch 'for-next' of git://git./linux/kernel/git/hch/vfs-queue * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue: vfs: add d_prune dentry operation vfs: protect i_nlink filesystems: add set_nlink() filesystems: add missing nlink wrappers logfs: remove unnecessary nlink setting ocfs2: remove unnecessary nlink setting jfs: remove unnecessary nlink setting hypfs: remove unnecessary nlink setting vfs: ignore error on forced remount readlinkat: ensure we return ENOENT for the empty pathname for normal lookups vfs: fix dentry leak in simple_fill_super() --- d211858837ff8d8e31942ca7d27e6e08b3b46f5e diff --cc fs/ext4/namei.c index 2a75eed2ef06,5f7fb46293be..aa4c782c9dd7 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@@ -1860,9 -1861,9 +1860,9 @@@ retry de->name_len = 2; strcpy(de->name, ".."); ext4_set_de_type(dir->i_sb, de, S_IFDIR); - inode->i_nlink = 2; + set_nlink(inode, 2); BUFFER_TRACE(dir_block, "call ext4_handle_dirty_metadata"); - err = ext4_handle_dirty_metadata(handle, dir, dir_block); + err = ext4_handle_dirty_metadata(handle, inode, dir_block); if (err) goto out_clear_inode; err = ext4_mark_inode_dirty(handle, inode); diff --cc include/linux/fs.h index 78af9385f415,23467d768cab..0c4df261af7e --- a/include/linux/fs.h +++ b/include/linux/fs.h @@@ -768,8 -768,19 +768,18 @@@ struct inode /* Stat data, not accessed from path walking */ unsigned long i_ino; - unsigned int i_nlink; + /* + * Filesystems may only read i_nlink directly. They shall use the + * following functions for modification: + * + * (set|clear|inc|drop)_nlink + * inode_(inc|dec)_link_count + */ + union { + const unsigned int i_nlink; + unsigned int __i_nlink; + }; dev_t i_rdev; - loff_t i_size; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime;