Whamcloud - gitweb
LU-5626 ldiskfs: update non-htree dotdot in rename 27/12927/2
authorBob Glossman <bob.glossman@intel.com>
Wed, 3 Dec 2014 23:33:49 +0000 (15:33 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 9 Dec 2014 00:41:17 +0000 (00:41 +0000)
commit639aca79b2c87aae2adf16463d50b9318f7429e5
treee83fa029e46a862cc35569b300ea1d5ae2e56412
parent76a7bae58006e4f6d1c13216df8cedda85e5e911
LU-5626 ldiskfs: update non-htree dotdot in rename

This mod duplicates changes previously committed only for el6
for sles11sp3.

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.

This patch is back-ported from the following one:
Lustre-commit: 4f8edadbbd3ba70d9236e98518182b4d3ff5acdb
Lustre-change: http://review.whamcloud.com/12585

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I1a51e85654837b9ce720ed925ccc4b90645f6e24
Reviewed-on: http://review.whamcloud.com/12927
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
ldiskfs/kernel_patches/patches/sles11sp2/ext4_data_in_dirent.patch