Bug 1157839 - link(2) corrupts meta-data of encrypted files
Summary: link(2) corrupts meta-data of encrypted files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: encryption-xlator
Version: mainline
Hardware: Unspecified
OS: Other
unspecified
high
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1169517
TreeView+ depends on / blocked
 
Reported: 2014-10-27 20:13 UTC by Edward Shishkin
Modified: 2015-05-14 17:44 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1169517 (view as bug list)
Environment:
Last Closed: 2015-05-14 17:28:07 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Edward Shishkin 2014-10-27 20:13:05 UTC
Description of problem:

step #26 of the tests/encryption/crypt.t failed:

How reproducible:

Run tests on NetBsd

Actual results:

=========================
TEST 26 (line 61): diff -u /mnt/glusterfs/0/testfile-symlink
/tmp/patchy-goodfile
diff: /mnt/glusterfs/0/testfile-symlink: Invalid argument

not ok 26 
RESULT 26: 2

Expected results:

TEST 26: OK

Additional info:

1) Complaints in /var/log/glusterfs/mnt-glusterfs-0.log:

[2014-10-23 19:05:40.972909] E [metadata.c:534:open_format_v1] 0-crypt: EMTD verification failed

2) link(2) corrupts meta-data string:

# getfattr -m . -d -e hex /mnt/glusterfs/0/testfile
trusted.glusterfs.crypt.att.cfmt=0x00e0d007795280a78ac90ea90982a00da2ebad6d352e

#ln /mnt/glusterfs/0/testfile /mnt/glusterfs/0/testfile-link

# getfattr -m . -d -e hex /mnt/glusterfs/0/testfile

trusted.glusterfs.crypt.att.cfmt=0x0000000c000480a78ac90ea9098200da2ebad6d352e62ba9283455afd12

Comment 1 Anand Avati 2014-10-27 20:41:59 UTC
REVIEW: http://review.gluster.org/8982 (Prevent metadata corruption in the race conditions between FOP->open() and FOP->link().) posted (#1) for review on master by Edward Shishkin (edward)

Comment 2 Anand Avati 2014-10-30 14:07:03 UTC
REVIEW: http://review.gluster.org/8982 (Prevent metadata corruption in the race conditions between FOP->open() and FOP->link().) posted (#2) for review on master by Edward Shishkin (edward)

Comment 3 Anand Avati 2014-10-30 19:41:07 UTC
REVIEW: http://review.gluster.org/9016 (Build test for https://review.gluster.org/8762) posted (#1) for review on master by Emmanuel Dreyfus (manu)

Comment 4 Anand Avati 2014-10-31 02:39:58 UTC
REVIEW: http://review.gluster.org/9016 (Build test for https://review.gluster.org/8762) posted (#2) for review on master by Emmanuel Dreyfus (manu)

Comment 5 Anand Avati 2014-10-31 02:52:48 UTC
REVIEW: http://review.gluster.org/9016 (Build test for https://review.gluster.org/8762) posted (#3) for review on master by Emmanuel Dreyfus (manu)

Comment 6 Anand Avati 2014-10-31 04:03:14 UTC
REVIEW: http://review.gluster.org/9016 (Build fix: xdrgen) posted (#4) for review on master by Emmanuel Dreyfus (manu)

Comment 7 Anand Avati 2014-11-02 16:41:39 UTC
COMMIT: http://review.gluster.org/9016 committed in master by Vijay Bellur (vbellur) 
------
commit 12bc39c144aa41a097435f2aab304ddfbbb9b625
Author: Emmanuel Dreyfus <manu>
Date:   Fri Oct 31 04:58:59 2014 +0100

    Build fix: xdrgen
    
    As discovered in https://review.gluster.org/8762, BSD systems fail to
    run xdrgen during glusterfs build. This seems to be caused by a
    difference between BSD make and GNU make whith implcit targets. The
    former seems to use absolute path here, which means we should not
    prepend it with the current directory path, otherwise we have the
    directory path twice and the files cannot be found my make.
    
    BUG: 1157839
    Change-Id: I178123bf6f3d9e963ff5b78839d498f530c05a97
    Signed-off-by: Emmanuel Dreyfus <manu>
    Reviewed-on: http://review.gluster.org/9016
    Reviewed-by: Harshavardhana <harsha>
    Tested-by: Harshavardhana <harsha>
    Reviewed-by: Humble Devassy Chirammal <humble.devassy>

Comment 8 Anand Avati 2014-11-04 11:24:52 UTC
REVIEW: http://review.gluster.org/9040 (Revert "Build fix: xdrgen") posted (#2) for review on master by Niels de Vos (ndevos)

Comment 9 Anand Avati 2014-11-04 13:41:36 UTC
COMMIT: http://review.gluster.org/9040 committed in master by Vijay Bellur (vbellur) 
------
commit edeb348a1cfe41aebd700e0689fa1139c1ebe408
Author: Niels de Vos <ndevos>
Date:   Tue Nov 4 03:18:08 2014 -0800

    Revert "Build fix: xdrgen"
    
    This reverts commit 12bc39c144aa41a097435f2aab304ddfbbb9b625
    
    This causes all regression tests to fail. Reverting for now, we can include a
    correct fix later.
    
    Change-Id: I3c8966288f66d0eafa2e94490e3b64a057b4f2c0
    URL: http://supercolony.gluster.org/pipermail/gluster-devel/2014-November/042759.html
    BUG: 1157839
    Reported-by: Emmanuel Dreyfus <manu>
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/9040
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 10 Anand Avati 2014-11-04 19:56:24 UTC
REVIEW: http://review.gluster.org/9046 (Build fix: xdrgen) posted (#1) for review on master by Emmanuel Dreyfus (manu)

Comment 11 Anand Avati 2014-11-14 06:16:22 UTC
COMMIT: http://review.gluster.org/9046 committed in master by Vijay Bellur (vbellur) 
------
commit 77a6917a650a88c12b6c27d37994f8bfef461345
Author: Emmanuel Dreyfus <manu>
Date:   Tue Nov 4 20:53:24 2014 +0100

    Build fix: xdrgen
    
    As discovered in https://review.gluster.org/8762, BSD systems fail to
    run xdrgen during glusterfs build. This seems to be caused by a
    difference between BSD make and GNU make whith implcit targets. The
    former seems to use absolute path here, which means we should not
    prepend it with the current directory path, otherwise we have the
    directory path twice and the files cannot be found my make.
    
    This is a second attempt after I178123bf6f3d9e963ff5b78839d498f530c05a97
    which was broken and reverted in I3c8966288f66d0eafa2e94490e3b64a057b4f2c0
    
    BUG: 1157839
    Change-Id: I797c536c319a156b71a42c82cbaf80bbf17b7234
    Signed-off-by: Emmanuel Dreyfus <manu>
    Reviewed-on: http://review.gluster.org/9046
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 12 Anand Avati 2014-12-01 05:41:42 UTC
COMMIT: http://review.gluster.org/8982 committed in master by Vijay Bellur (vbellur) 
------
commit 45af6c5fc385f2c948bdb387585b3e0a41ccbcde
Author: Edward Shishkin <edward>
Date:   Mon Oct 27 21:35:16 2014 +0100

    Prevent metadata corruption in the race conditions between
    FOP->open() and FOP->link().
    
    Problem: crypt_open() modifies @local->format, which is used
    by crypt_link() to store the updated metadata string on disk.
    This results in metadata corruption.
    
    Fixup: Don't modify @local->format by FOP->open(). Instead
    modify a local copy, allocated in the low-level meta-data
    handler open_format_v1().
    
    Change-Id: I046bb39ddefc33afe59c8d3b1a2fa798298f8499
    BUG: 1157839
    Signed-off-by: Edward Shishkin <edward>
    Reviewed-on: http://review.gluster.org/8982
    Reviewed-by: Emmanuel Dreyfus <manu>
    Tested-by: Emmanuel Dreyfus <manu>
    Tested-by: Gluster Build System <jenkins.com>

Comment 13 Anand Avati 2014-12-01 21:20:17 UTC
REVIEW: http://review.gluster.org/9225 (Prevent metadata corruption in the race conditions between FOP->open() and FOP->link().) posted (#1) for review on release-3.6 by Edward Shishkin (edward)

Comment 16 Niels de Vos 2015-05-14 17:28:07 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 17 Niels de Vos 2015-05-14 17:35:40 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 18 Niels de Vos 2015-05-14 17:38:02 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 19 Niels de Vos 2015-05-14 17:44:20 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.