Bug 1210689

Summary: BitRot :- Files marked as 'Bad' should not be accessible from mount
Product: [Community] GlusterFS Reporter: Rachana Patel <racpatel>
Component: bitrotAssignee: Raghavendra Bhat <rabhat>
Status: CLOSED CURRENTRELEASE QA Contact: RajeshReddy <rmekala>
Severity: high Docs Contact: bugs <bugs>
Priority: medium    
Version: mainlineCC: amukherj, bugs, mzywusko, nsathyan
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.8rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1224227 1236289 1241529 (view as bug list) Environment:
Last Closed: 2016-06-16 12:49:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1186580, 1236289, 1241529    

Description Rachana Patel 2015-04-10 11:23:37 UTC
Description of problem:
=======================
If file is marked as 'Bad' then any access to that file from mount should get 'EIO' error till its recovered .(recovery using self heal/EC or manual)


Version-Release number of selected component (if applicable):
=============================================================
3.7dev-0.952.gita7f1d08.el6.x86_64

How reproducible:
=================
always

Steps to Reproduce:
===================
1. create and mount volume.
2. enable bitrot
3. create file
4. modify file from backend(not from mount)
5. Once file is marked as bad, try to access it from mount.

[]# getfattr -d -m .  /pavanbrick3/*/f9 -e hex
getfattr: Removing leading '/' from absolute path names
# file: pavanbrick3/r1/f9
security.selinux=0x756e636f6e66696e65645f753a6f626a6563745f723a64656661756c745f743a733000
trusted.gfid=0xc2ca6098ab304d9c9027df491e07c0f7
trusted.glusterfs.bad-file=0x3100
trusted.glusterfs.bit-rot.signature=0x010000000000000004000000000000009ad89c03b457431979ab5c44131dda04d1bc1652271cc7c37a91c3a10de6a6b0
trusted.glusterfs.bit-rot.version=0x0400000000000000552623db00042680

Actual Result:-
===============
[root@rhs-client37 rac1]# cat f9
new
new
new
new
something
corrupt


Expect Result:-
===============
 Files marked as 'Bad' should not be accessible from mount and user should get EIO error

Comment 2 Anand Avati 2015-06-09 11:35:04 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#2) for review on master by Raghavendra Bhat (raghavendra)

Comment 3 Anand Avati 2015-06-16 20:12:55 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#3) for review on master by Raghavendra Bhat (raghavendra)

Comment 4 Anand Avati 2015-06-21 13:09:31 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#4) for review on master by Venky Shankar (vshankar)

Comment 5 Anand Avati 2015-06-24 09:07:26 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#5) for review on master by Venky Shankar (vshankar)

Comment 6 Anand Avati 2015-06-24 20:01:00 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#7) for review on master by Raghavendra Bhat (raghavendra)

Comment 7 Anand Avati 2015-06-24 20:01:02 UTC
REVIEW: http://review.gluster.org/11389 (features/bit-rot-stub: do not allow setxattr and removexattr on bit-rot xattrs) posted (#1) for review on master by Raghavendra Bhat (raghavendra)

Comment 8 Anand Avati 2015-06-26 06:18:40 UTC
REVIEW: http://review.gluster.org/11389 (features/bit-rot-stub: do not allow setxattr and removexattr on bit-rot xattrs) posted (#2) for review on master by Raghavendra Bhat (raghavendra)

Comment 9 Anand Avati 2015-06-26 06:18:47 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#8) for review on master by Raghavendra Bhat (raghavendra)

Comment 10 Anand Avati 2015-06-26 10:38:39 UTC
REVIEW: http://review.gluster.org/11389 (features/bit-rot-stub: do not allow setxattr and removexattr on bit-rot xattrs) posted (#3) for review on master by Raghavendra Bhat (raghavendra)

Comment 11 Anand Avati 2015-06-26 15:11:24 UTC
REVIEW: http://review.gluster.org/11389 (features/bit-rot-stub: do not allow setxattr and removexattr on bit-rot xattrs) posted (#4) for review on master by Raghavendra Bhat (raghavendra)

Comment 12 Anand Avati 2015-06-26 15:11:26 UTC
REVIEW: http://review.gluster.org/11126 (features/bit-rot-stub: deny access to bad objects) posted (#10) for review on master by Raghavendra Bhat (raghavendra)

Comment 13 Anand Avati 2015-06-27 11:17:36 UTC
COMMIT: http://review.gluster.org/11126 committed in master by Venky Shankar (vshankar) 
------
commit 15dcfe98caa573e87d898cb66c13ef7187730c6b
Author: Raghavendra Bhat <raghavendra>
Date:   Tue May 26 19:22:14 2015 +0530

    features/bit-rot-stub: deny access to bad objects
    
    * Access to bad objects (especially operations such as open, readv, writev)
      should be denied to prevent applications from getting wrong data.
    
    * Do not allow anyone apart from scrubber to set bad object xattr.
    
    * Do not allow bad object xattr to be removed.
    
    Change-Id: Ia9185a067233a9f26e3d41d41d11d9a4eb0da827
    BUG: 1210689
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Signed-off-by: Venky Shankar <vshankar>
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/11126
    Tested-by: NetBSD Build System <jenkins.org>

Comment 14 Anand Avati 2015-06-27 11:18:50 UTC
COMMIT: http://review.gluster.org/11389 committed in master by Venky Shankar (vshankar) 
------
commit 0a24b8f2be5f8b124d76a13f2a4b6cb9058c9a30
Author: Raghavendra Bhat <raghavendra>
Date:   Wed Jun 24 20:06:01 2015 +0530

    features/bit-rot-stub: do not allow setxattr and removexattr on bit-rot xattrs
    
    * setxattr and {f}removexattr of versioning, signature and bad-file xattrs are
      returned with error.
    
    Change-Id: Ib423466195d1d8e4c6f80c2906a574e21ed624fb
    BUG: 1210689
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/11389
    Tested-by: NetBSD Build System <jenkins.org>
    Reviewed-by: Venky Shankar <vshankar>

Comment 15 Nagaprasad Sathyanarayana 2015-10-25 15:19:01 UTC
Fix for this BZ is already present in a GlusterFS release. You can find clone of this BZ, fixed in a GlusterFS release and closed. Hence closing this mainline BZ as well.

Comment 16 Niels de Vos 2016-06-16 12:49:31 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.8.0, please open a new bug report.

glusterfs-3.8.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://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user