]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: avoid setting ->d_op twice
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 21 Feb 2012 09:04:28 +0000 (17:04 +0800)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 14 Nov 2012 16:24:34 +0000 (08:24 -0800)
commit3d19da121e2d6afa36e96e6e89fb9dea26617198
treeb0a334ea725847fc0df99c6e48ceb0360b3f8390
parent98b1d566ccb4e64a877057a0fb08179876685178
Btrfs: avoid setting ->d_op twice

Follow those instructions, and you'll trigger a warning in the
beginning of d_set_d_op():

  # mkfs.btrfs /dev/loop3
  # mount /dev/loop3 /mnt
  # btrfs sub create /mnt/sub
  # btrfs sub snap /mnt /mnt/snap
  # touch /mnt/snap/sub
  touch: cannot touch `tmp': Permission denied

__d_alloc() set d_op to sb->s_d_op (btrfs_dentry_operations), and
then simple_lookup() reset it to simple_dentry_operations, which
triggered the warning.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
(cherry picked from commit 848cce0d4102b5b4b26b0987b43e1919d462afe2)
fs/btrfs/inode.c