Project

General

Profile

Bug #6770

ceph fscache: write file more than a page size to orignal file cause cachfiles bug on EOF

Added by Min Chen over 10 years ago. Updated almost 4 years ago.

Status:
Can't reproduce
Priority:
Low
Assignee:
Category:
Correctness/Safety
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
kceph
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When mount -o fsc on cephfs, write more than page size content to a file (less than a page), when each time writing 8bytes, then read it immediately, a bug EOF will be caught by cachfiles.


Related issues

Related to CephFS - Feature #6373: kcephfs: qa: test fscache In Progress

History

#1 Updated by Sage Weil about 10 years ago

  • Category changed from 46 to 53

#2 Updated by Greg Farnum over 7 years ago

  • Component(FS) kceph added

#3 Updated by Greg Farnum over 7 years ago

  • Category changed from 53 to Correctness/Safety
  • Assignee deleted (Min Chen)
  • Priority changed from Normal to Low

fscache has been through a lot of changes; anybody know if this is still a problem?

#4 Updated by Patrick Donnelly over 4 years ago

#5 Updated by Xiubo Li about 4 years ago

Test the latest ceph and kclient, it works well:

# ./bin/ceph -v
ceph version 15.1.0-2068-g9fa50ac (9fa50ac661749c05688236e951821f1dc21bb62c) octopus (rc)

# uname -r
5.6.0-rc6+

# rm -f c.txt; dd oflag=direct if=/dev/sda1 of=/mnt/cephfs/c.txt bs=8 count=1; cat c.txt
1+0 records in
1+0 records out
8 bytes (8 B) copied, 0.0160763 s, 0.5 kB/s
XFSB

Also tried bs=[4000/4096/5000/8096/9000...], all works well.

Also test with the following simple code, it works well too.

  2 #include <stdio.h>          
  3 #include <unistd.h>
  4 #include <sys/types.h>         
  5 #include <sys/stat.h>          
  6 #include <fcntl.h>             
  7    
  8                                
  9 int main(int argc, char **argv)
 10 {
 11         char *file = argv[1];  
 12         int i = 0, fd, ret;
 13         char buf[8096] = {'\0'};
 14 
 15         while (i++ < 1000) {
 16                 fd = open(file, O_WRONLY|O_CREAT|O_TRUNC|O_DIRECT, 0666);
 17                 if (fd < 0) {
 18                         printf("open failed %m\n");         
 19                         return -1;
 20                 }
 21                 write(fd, "12345678", 8);           
 22                 close(fd);
 23 
 24                 fd = open(file, O_RDONLY, 0666);    
 25                 if (fd < 0) {
 26                         printf("open failed %m\n");         
 27                         return -1;
 28                 }
 29                 ret = read(fd, buf, 8096);          
 30                 close(fd);
 31                 printf("buf[%s], ret: %d\n", buf, ret);
 32         }
 33 
 34         return 0;
 35 }   

#6 Updated by Xiubo Li about 4 years ago

  • Assignee set to Xiubo Li

#7 Updated by Xiubo Li almost 4 years ago

  • Status changed from New to In Progress

#8 Updated by Xiubo Li almost 4 years ago

  • Status changed from In Progress to Can't reproduce

Also available in: Atom PDF