[LTP] [PATCH v3] fcntl/fcntl32.c: add F_SETLEASE and F_WRLCK argument test

Guangwen Feng fenggw-fnst@cn.fujitsu.com
Wed Oct 7 12:00:26 CEST 2015


Hi!
Thanks for your reply.

On 2015/10/01 00:41, Cyril Hrubis wrote:
> Hi!
>> +int main(int ac, char **av)
>> +{
>> +	int lc;
>> +	int tc;
>> +	long type;
>> +
>> +	tst_parse_opts(ac, av, NULL, NULL);
>> +
>> +	setup();
>> +
>> +	switch ((type = tst_fs_type(cleanup, "."))) {
>> +	case TST_NFS_MAGIC:
>> +	case TST_RAMFS_MAGIC:
>> +	case TST_TMPFS_MAGIC:
>> +		tst_brkm(TCONF, cleanup, "%s filesystem does not support "
>> +			 "fcntl(2)'s F_SETLEASE operation",
>> +			 tst_fs_type_name(type));
>> +	default:
>> +		break;
>> +	}
> 
> Same as the second one. I would preffer figuring out that the fcntl() is
> unsupported by actually trying to use it.
> 

It will return EAGAIN when we actually use it, I don't think it's a reasonable errno,
since on ramfs or tmpfs, when opening or creating a new file, the dentry->d_count
will get an extra count to be 2 but not 1. Please have a look at the following link:
http://www.gossamer-threads.com/lists/linux/kernel/913113

I feel the expression is not clear, it should be "cannot do fcntl()'s F_SETLEASE operation
on %s filesystem"

> 
> Otherwise it looks fine.
> 


More information about the Ltp mailing list