metastore may lose data; gives cryptic error message when storing extended attributes without values

Bug #937306 reported by Todd A. Jacobs
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
metastore (Debian)
Fix Released
Unknown
metastore (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

DATA LOSS WARNING: Using metastore in its current condition can lead to loss of metadata. See below for details.

First of all, metastore provides confusing and useless feedback to the user when storing extended attributes without defined values. To consistently re-create this problem:

$ touch foo
$ setfattr -n user.bar foo
$ metastore -s foo
Failed to write to file: Success
$ echo $?
1

The error message and exit status imply the operation has failed, but it has not--at least, not completely. You can see that metastore *appears* to have succeeded as follows:

$ rm foo
$ touch foo
$ metastore -a foo
./foo: changing metadata
./foo: adding xattr user.bar
$ echo $?
0
$ getfattr -d foo
# file: foo
user.bar

So, the .metadata file seems to contains all the correct information, but it provides this contradictory and cryptic error message to the user on save. However, the .metadata file *is* actually broken, but you only see it when saving multiple extended attributes where at least one of them has no defined value.

$ rm foo; rm .metadata
$ touch foo
$ setfattr -n user.bar foo
$ setfattr -n user.baz -v quux foo
$ getfattr -d
# file: foo
user.bar
user.baz="quux"
$ metastore -s foo
Failed to write to file: Success
$ echo $?
1
$ rm foo
$ touch foo
$ metastore -a
Attempt to read beyond end of file, corrupt file?
$ echo $?
1

So, there are really two things that need fixing:

  1. The incredibly cryptic error message on save. What is the actual error condition it is trying to report?
  2. The proper handling of extended attributes without values.

Since the version of tar that ships with Ubuntu does not handle extended attributes, anyone who relies on metastore to handle their extended attributes is likely to encounter data loss, so this bug should receive a higher priority than might otherwise be warranted.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: metastore 1+20080623+debian-2
ProcVersionSignature: Ubuntu 3.0.0-16.28-generic 3.0.17
Uname: Linux 3.0.0-16-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Mon Feb 20 17:29:07 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: metastore
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Todd A. Jacobs (codegnome) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in metastore (Ubuntu):
status: New → Confirmed
Revision history for this message
zw (iwilcox) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "metastore-empty-xattr.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in metastore (Debian):
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package metastore - 1+20080623+debian-3

---------------
metastore (1+20080623+debian-3) unstable; urgency=low

  * Handle xattrs with empty value correctly; thanks to Przemysław Pawełczyk
    (closes: #676572, LP: #937306).
  * Switch to debhelper compat level 9.
  * Enable all hardening options.
  * Don't overwrite environment CFLAGS, use CPPFLAGS.
  * Bump Standards-Version to 3.9.3, no changes needed.

 -- Romain Francoise <email address hidden> Sun, 10 Jun 2012 17:42:59 +0200

Changed in metastore (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.