Hi Eric,
Hmm, yes there apparently still is an unimplemented corner case.
This is in ntfs_ir_reparent() in index.c, there is the comment :
/* FIXME: revert index root */
goto clear_bmp;
This happens when there is no more space to extend the resident
index root, and no space either to create a non-resident
index allocation. The current code leaves the MFT record in
a bad state (index root structured to non resident index, but
no index allocation). Reverting to the initial state is not
satisfactory, a new extent has to be allocated and some
attribute has to be expelled from the initial entry to make
space.
I cannot fix this at the moment, will do later.
Jean-Pierre
Eric Biggers wrote:
> Hi,
>
> During a randomized test I discovered that ntfs_create() can fail with ENOSPC
> when adding a file to a directory that has many named data streams,
> independently of the size of the volume. I am still investigating the
> problem,
> but I thought I'd post some reproducing code. The problem is very sensitive
> to
> the length of the directory name and the number of named data streams; it even
> goes away if the number of named data streams is *increased*. So far I am
> thinking that the bug has to do with the MFT record filling up just as the
> child
> file is added and the existing attribute records not being correctly moved to
> an
> AT_ATTRIBUTE_LIST attribute.
>
> The problem can be reproduced on a FUSE mount using the script below:
>
> #!/bin/bash
>
> set -e
>
> dirname="rgclucukwqvcoheicmlkgmshlqddqnrxebzrftwndexmfxulbrqiqxeqxxyhjgyprdpekooto"
> fallocate -l 1G ntfs.img
> mkntfs --fast --force ntfs.img
> mkdir -p mnt
> ntfs-3g ntfs.img mnt
> echo "Creating directory mnt/$dirname"
> mkdir mnt/$dirname
> for stream_name in {a..p}; do
> echo "Creating named stream mnt/$dirname:$stream_name"
> setfattr -n user.$stream_name -v 0x mnt/$dirname
> done
> pathname="mnt/$dirname/a"
> echo "Creating file $pathname"
> touch $pathname # Fails with "No space left on device"
>
------------------------------------------------------------------------------
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel