Bug 1484486 - File-level WORM allows mv over read-only files
Summary: File-level WORM allows mv over read-only files
Alias: None
Product: GlusterFS
Classification: Community
Component: unclassified
Version: 3.8
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
Whiteboard: worm
Depends On:
TreeView+ depends on / blocked
Reported: 2017-08-23 17:45 UTC by Lucas Ferreira
Modified: 2017-11-07 10:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1480788
Last Closed: 2017-11-07 10:39:47 UTC
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:

Attachments (Terms of Use)

Description Lucas Ferreira 2017-08-23 17:45:25 UTC
+++ This bug was initially created as a clone of Bug #1480788 +++

Description of problem:

It is possible to move one recently created file over a read only file, overwriting it.

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

3.10 and 3.11

How reproducible:

Steps to Reproduce:

1. create a worm volume file level
$ gluster volume create v1 replica 3 172.17.0.{2,3,4}:/mnt/v1 force
$ gluster volume set v1 features.read-only "off"
$ gluster volume set v1 features.worm "off"
$ gluster volume set v1 features.worm-file-level "on"
$ gluster volume set v1 features.retention-mode relax
$ gluster volume set v1 features.auto-commit-period 20
$ gluster volume set v1 features.default-retention-period 600
$ gluster volume start v1
$ mount -t glusterfs /home/lucas/storage

Volume Name: v1
Type: Replicate
Volume ID: 72a968d9-9aaa-4cde-9954-4e5a91065abf
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Options Reconfigured:
features.default-retention-period: 600
features.auto-commit-period: 20
features.retention-mode: relax
features.worm-file-level: on
features.worm: off
features.read-only: off
transport.address-family: inet
nfs.disable: on

2. create file on WORM volume (File Level)
$ cd /home/lucas/storage
$ echo "Hello World" > testfile

3. wait for the auto commit time and try to delete it
$ rm testfile
rm: cannot remove 'testfile': Read-only file system

4. create a new file and do a mv command to overwrite the existing file
$ echo "Aloha" > testfile2
$ mv testfile2 testfile

Actual results:

- The mv command executes successfully and overwrites the read only file.

Expected results:

- The mv command should fail, giving some error regarding a read only file.

Additional info:

Comment 1 Worker Ant 2017-08-23 18:46:01 UTC
REVIEW: https://review.gluster.org/18105 (features/worm: Adding check to newloc when doing rename) posted (#1) for review on release-3.8 by Anonymous Coward

Comment 2 Worker Ant 2017-10-10 20:26:31 UTC
REVIEW: https://review.gluster.org/18483 (features/worm: Adding check to newloc when doing rename) posted (#1) for review on release-3.8 by Lucas Ferreira (luneo7@gmail.com)

Comment 3 Niels de Vos 2017-11-07 10:39:47 UTC
This bug is getting closed because the 3.8 version is marked End-Of-Life. There will be no further updates to this version. Please open a new bug against a version that still receives bugfixes if you are still facing this issue in a more current release.

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