Whamcloud - gitweb
LU-7057 utils: use stronger flags when opening volatile files
Existing files with volatile-ish names may be accidentally opened by
lfs_migrate(). This is not the intent so disallow this behavior by
adding O_EXCL and O_NOFOLLOW to the flags to open(). Use the original
file's MDT index and a random suffix when constructing the volatile
file name (as is done in llapi_create_volatile_idx()) and reduce the
mode of the file created.
To handle pre-existing files use a do while lookup around the volatile
opens in llapi_create_volatile_idx() and lfs_migrate().
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I399d30104d841df13fe1051aaa8264514911714d
Reviewed-on: http://review.whamcloud.com/16166
Tested-by: Jenkins
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Andreas Dilger <andreas.dilger@intel.com>