[Bugs] [Bug 1775461] protocol/client : After "Remove lock recovery logic from client and server protocol translators" patch commit, causing add fcntl lock on the file twice.
bugzilla at redhat.com
bugzilla at redhat.com
Mon Dec 9 06:36:32 UTC 2019
https://bugzilla.redhat.com/show_bug.cgi?id=1775461
--- Comment #3 from yinkui <13965432176 at 163.com> ---
1、the test file is a hand-written program.for example:
struct flock _lock;
char d[10] = {0};
char a;
_lock.l_type = F_WRLCK;
_lock.l_whence = SEEK_SET;
_lock.l_start = 0;
_lock.l_len = 0;
int file = open(
"/mnt/fourth_file5.txt",O_CREAT|O_RDWR,S_IRWXU|S_IRGRP|S_IWGRP|S_IRWXO );
if ( file<0 )
{
puts( "open error" );
return 0;
}
int ret = fcntl( file,F_SETLK,&_lock );
if ( ret < 0 )
{
printf(" errno: %s\n", strerror(errno));
close( file );
return 0;
}
puts( "getchar ..." );
a = getchar();
printf(" char: %c\n", a);
_lock.l_type = F_UNLCK;
_lock.l_whence = SEEK_SET;
_lock.l_start = 0;
_lock.l_len = 0;
ret = fcntl( file,F_SETLK,&_lock );
if ( ret < 0 )
{
puts( "unlock error" );
printf(" errno: %s\n", strerror(errno));
}
close( file );
2、"afr group" means the lock file fourth_file5.txt which bricks store it. And
kill all glusterfsd which bricks store the fourth_file5.txt. Then start all
glusterfsd force and run the hand-written program again. It's also can add lock
on the fourth_file5.txt. It's not true add the F_SETLK lock twice on the same
file.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list