Re: [PATCH RFC 3/3] fs: add FSCONFIG_CMD_CREATE_EXCL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	/* require the new mount api */
> +	if (exclusive && (fc->ops == &legacy_fs_context_ops))

No need for the inner braces.

> +		return -EOPNOTSUPP;
> +
>  	fc->phase = FS_CONTEXT_CREATING;
> +	fc->exclusive = exclusive;
>  
>  	ret = vfs_get_tree(fc);
> -	if (ret)
> +	if (ret) {
> +		fc->exclusive = false;

What's the point in clearing the flag on error?

> +	case FSCONFIG_CMD_CREATE_EXCL:
> +		fallthrough;
>  	case FSCONFIG_CMD_CREATE:
> -		ret = vfs_cmd_create(fc);
> +		ret = vfs_cmd_create(fc, cmd == FSCONFIG_CMD_CREATE_EXCL);
>  		if (ret)
>  			break;
>  		return 0;

Nitpick, but I always find it cleaner to do something like:

	case FSCONFIG_CMD_CREATE_EXCL:
		ret = vfs_cmd_create(fc, true)
		break;
 	case FSCONFIG_CMD_CREATE:
		ret = vfs_cmd_create(fc, false);

but that might just be preference.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux