Bug 1487502 - able to delete files on file-based worm volume
Summary: able to delete files on file-based worm volume
Alias: None
Product: GlusterFS
Classification: Community
Component: unclassified
Version: 3.11
Hardware: Unspecified
OS: Linux
Target Milestone: ---
Assignee: Vishal Pandey
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2017-09-01 06:06 UTC by Jurgen Reij
Modified: 2018-06-20 18:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-06-20 18:25:05 UTC
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:

Attachments (Terms of Use)
sosreport client (7.40 MB, application/x-xz)
2017-09-01 06:24 UTC, Jurgen Reij
no flags Details
sosreport server (7.55 MB, application/x-xz)
2017-09-01 06:25 UTC, Jurgen Reij
no flags Details

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):

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

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.

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