Project

General

Profile

Actions

Bug #24897

closed

client: writes rejected by quota may truncate/zero parts of file

Added by yuanli zhu almost 6 years ago. Updated almost 6 years ago.

Status:
Rejected
Priority:
Urgent
Assignee:
-
Category:
Correctness/Safety
Target version:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
mimic
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
fs
Component(FS):
Client
Labels (FS):
quotas, task(medium)
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I found a BUg as below:

First:setfattr -n ceph.quota.max_bytes -v 5 /nas/cephfs/abc
Second:echo "abc" > /nas/cephfs/abc/test.log
Third:cat /nas/cephfs/abc/test.log

[root@node1 abc]# cat test.log
abc

Next i run the command:echo "abcdefg" > /nas/cephfs/abc/test.log

[root@node1 abc]# echo "abcdefg" > test.log
-bash: echo: write error: Disk quota exceeded

then i found my file data is gone.

[root@node1 abc]# cat test.log

Actions #1

Updated by Greg Farnum almost 6 years ago

  • Project changed from Ceph to CephFS
Actions #2

Updated by Patrick Donnelly almost 6 years ago

  • Subject changed from ll_write in Client.cc drop data to client: writes rejected by quota may truncate/zero parts of file
  • Category set to Correctness/Safety
  • Priority changed from Normal to Urgent
  • Target version set to v14.0.0
  • Source set to Community (user)
  • Backport set to mimic
  • Severity changed from 3 - minor to 2 - major
  • Component(FS) Client added
  • Labels (FS) quotas, task(medium) added
Actions #3

Updated by Jeff Layton almost 6 years ago

I think this is probably NOTABUG. The shell redirect will end up opening the destination file with O_TRUNC which will clean out the data. After that, the write is (correctly) rejected since it would overrun the quota. But, by then it's too late to save the data that was in the file before.

To correctly test this, you'd need to open the file without O_TRUNC, and then overwrite the data that's there. I'm not sure if that's possible with a shell redirect.

Actions #4

Updated by Patrick Donnelly almost 6 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF