From: Török Edwin on
On 06/08/2010 02:14 PM, Theodore Tso wrote:
>
> If you pull the plug without fsyncing the file, you will end up with a zero-length file -- or possibly no file at all, even with data=ordered. If you really want to preserve data after pulling the power cord immediately after a write were the application hasn't done an fsync() or a sync() call, you can mount the file system with the mount option -o sync --- but then the performance will be horrible.
>
> It's all a tradeoff of what you think is important....
>

I think you should either get the old file, or the new file (if you
don't fsync), and not some random data from another file.
The manual entry for data=writeback only says that you may get old data
after a crash/recovery, not that you may get old/new data from *another*
file.

On the other hand I didn't specify any mount options, and I got
data=ordered. So is data=ordered the default or not?
Or does it depend whether you use ext3 or ext4 driver for ext3?

/etc/fstab has:
/dev/md3 / ext3 noatime,errors=remount-ro 0 1

and my ext* related config options:
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_DEBUG is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set

So I use the ext4 driver for the ext3 partition (I intended to convert
it to ext4 at some point, but didn't have time to do so yet).

This is with 2.6.34-00179-gdebb980 (drm-radeon-testing, which is
basically 2.6.34 + some radeon specific stuff).

Best regards,
--Edwin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jeffrey Merkey on
On Mon, Jun 7, 2010 at 11:40 PM, <Valdis.Kletnieks(a)vt.edu> wrote:
> On Mon, 07 Jun 2010 20:37:06 MDT, Jeffrey Merkey said:
>> Cool. �I'll use that from now on. �wonder if the source code came from
>> xdump 10 years ago ... LOL
>
> Probably not, given that 'man hexdump' says:
>
> BSD � � � � � � � � � � � � � � April 18, 1994 � � � � � � � � � � � � � � BSD
>
> Plus, they obviously rolled the code for '-e formatstring' themselves, nobody
> could have been so desperate to steal that code. ;)
>
> hexdump -e '"%08.08_ax �" 4/4 "%08X " " �" 4/4 "%08x " ' -e '" �*" 32/1 "%_p"' -e '"*\n"'
>
> That's so old-skool it hurts. :)
>
>
>

LOL. :)

Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: david on
On Tue, 8 Jun 2010, T?r?k Edwin wrote:

> On 06/08/2010 02:14 PM, Theodore Tso wrote:
>>
>> If you pull the plug without fsyncing the file, you will end up with a zero-length file -- or possibly no file at all, even with data=ordered. If you really want to preserve data after pulling the power cord immediately after a write were the application hasn't done an fsync() or a sync() call, you can mount the file system with the mount option -o sync --- but then the performance will be horrible.
>>
>> It's all a tradeoff of what you think is important....
>>
>
> I think you should either get the old file, or the new file (if you
> don't fsync), and not some random data from another file.

my understanding of the way to get what you want is to

write tempfile
sync
mv temptfile realfile

this also has the advantage that it will work on all filesystems.

David Lang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/