Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1487502

Summary: able to delete files on file-based worm volume
Product: [Community] GlusterFS Reporter: Jurgen Reij <jurgen.reij>
Component: unclassifiedAssignee: Vishal Pandey <vpandey>
Status: CLOSED EOL QA Contact:
Severity: low Docs Contact:
Priority: high    
Version: 3.11CC: atumball, bugs, ksubrahm, mhergaar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-20 18:25:05 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:
Attachments:
Description Flags
sosreport client
none
sosreport server none

Description Jurgen Reij 2017-09-01 06:06:38 UTC
Description of problem:
it is possible to delete a file in immutable and undeletable state on a file-based worm volume

Version-Release number of selected component (if applicable):
3.11.2

How reproducible:
[vagrant@client1 share]$ date && echo "testfile" >> testfile
Wed Aug 30 09:18:06 CEST 2017
[vagrant@client1 share]$ date && rm testfile
Wed Aug 30 09:18:15 CEST 2017
rm: cannot remove ‘testfile’: Read-only file system
[vagrant@client1 share]$ date && touch -a testfile
Wed Aug 30 09:18:23 CEST 2017
[vagrant@client1 share]$ date && rm testfile
Wed Aug 30 09:18:24 CEST 2017


Steps to Reproduce:
1.create volume. enable file-based worm
2.features.worm-file-level: on
features.default-retention-period: 60
features.auto-commit-period: 5
3.follows steps in "how reproducible"

Actual results:
the file was deleted

Expected results:
it should not be possible to delete files in immutable undeletable state 


Additional info:

Comment 1 Jurgen Reij 2017-09-01 06:24:57 UTC
Created attachment 1320839 [details]
sosreport client

sosreport client

Comment 2 Jurgen Reij 2017-09-01 06:25:38 UTC
Created attachment 1320840 [details]
sosreport server

Comment 3 Karthik U S 2017-09-06 07:27:12 UTC
This is not bug. It is behaving as expected. You can see the "Updating the retention time" section in the blog
http://blog.gluster.org/2016/07/worm-write-once-read-multiple-retention-and-compliance-2/

Once a file becomes worm-retained and you want to change the retention period (till when it should be undeletable) of the file, you can use the "touch -a" or "touch -t" or any other equivalent commands which updates the access time of the file. We depend on the access time of the file to convert it from worm-retained to worm state.
In your case, when you did the "touch -a testfile" it updated the access time of the file to the current time. So after that the next "rm testfile" command did the transition from worm-retained to worm state since the retention period was expired, and deleted the file.

Comment 4 Shyamsundar 2018-06-20 18:25:05 UTC
This bug reported is against a version of Gluster that is no longer maintained (or has been EOL'd). See https://www.gluster.org/release-schedule/ for the versions currently maintained.

As a result this bug is being closed.

If the bug persists on a maintained version of gluster or against the mainline gluster repository, request that it be reopened and the Version field be marked appropriately.