Whamcloud - gitweb
LU-5626 ldiskfs: update non-htree dotdot in rename 39/11939/11
authorPatrick Farrell <paf@cray.com>
Tue, 23 Sep 2014 15:14:24 +0000 (10:14 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 30 Oct 2014 02:14:43 +0000 (02:14 +0000)
commit38ec486aeee20345a86dbbd2022d7976337c49b8
treeaeda808795523609572b74406e7414fff8dc3ceb
parent8e3d8b71fb4ec61f93d6fdcdaf8afe2f25fdda10
LU-5626 ldiskfs: update non-htree dotdot in rename

In 2.4+, when renaming a directory, its old dotdot entry will
be removed firstly, then the new dotdot entry is inserted, and
ldiskfs tries to append FID-in-dirent to the new entry.
But the space for dotdot entry may not be enough to hold
the new dotdot with FID-in-dirent, such as an MDT device
restored from file-level backup, or a device upgraded from 1.8.

In that case, for non-HTree directories, the ".." entry
will be written in the next available space in the directory
block.  This is invalid, as the ".." entry must be the
second entry in the block.

The same bug was fixed for HTree directories in LU-2638.
As Fan Yong said then: we do not want to introduce
complex logic to handle directory data moving, instead, in
such case, ignore the FID-in-dirent for the new dotdot entry,
and just insert the new dotdot entry.

There is one known flaw: This patch, like the one for
LU-2638, skips the entire data section rather than just
the FID.  This could cause trouble if something else ever
uses this section with ".." entries.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I57fc492e694973f5020191e4e2c79c74c7c4f18c
Reviewed-on: http://review.whamcloud.com/11939
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-data-in-dirent.patch