Btrfs: avoid setting ->d_op twice
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 21 Feb 2012 09:04:28 +0000 (17:04 +0800)
committerDavid Sterba <dsterba@suse.cz>
Wed, 18 Apr 2012 17:12:44 +0000 (19:12 +0200)
commit848cce0d4102b5b4b26b0987b43e1919d462afe2
tree92f2be7324929c9b213c1fcd616b11cc1a479d20
parentd53ba47484ed6245e640ee4bfe9d21e9bfc15765
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>
fs/btrfs/inode.c