Re: [PATCH] ext4: fix same-dir rename when inline data directory overflows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 25, 2014 at 12:40:31PM -0700, Darrick J. Wong wrote:
> When performing a same-directory rename, it's possible that adding or
> setting the new directory entry will cause the directory to overflow
> the inline data area, which causes the directory to be converted to an
> extent-based directory.  Under this circumstance it is necessary to
> re-read the directory when deleting the old dirent because the "old
> directory" context still points to i_block in the inode table, which
> is now an extent tree root!  The delete fails with an FS error, and
> the subsequent fsck complains about incorrect link counts and
> hardlinked directories.
> 
> Test case (originally found with flat_dir_test in the metadata_csum
> test program):
> 
> # mkfs.ext4 -O inline_data /dev/sda
> # mount /dev/sda /mnt
> # mkdir /mnt/x
> # touch /mnt/x/changelog.gz /mnt/x/copyright /mnt/x/README.Debian
> # sync
> # for i in /mnt/x/*; do mv $i $i.longer; done
> # ls -la /mnt/x/
> total 0
> -rw-r--r-- 1 root root 0 Aug 25 12:03 changelog.gz.longer
> -rw-r--r-- 1 root root 0 Aug 25 12:03 copyright
> -rw-r--r-- 1 root root 0 Aug 25 12:03 copyright.longer
> -rw-r--r-- 1 root root 0 Aug 25 12:03 README.Debian.longer
> 
> (Hey!  Why are there four files now??)
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Thanks, applied.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux