Whamcloud - gitweb
LU-8846 lfs: try to unlink volatile file in lfs_migrate() 42/23842/3
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 17 Nov 2016 17:32:15 +0000 (11:32 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 17 Dec 2016 05:48:28 +0000 (05:48 +0000)
In lfs_migrate() try to unlink the volatile file in case the MDT does
not support volatile file creation.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I1e777c22ebde22e0c2080683a2b13650da7ebc7a
Reviewed-on: https://review.whamcloud.com/23842
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lfs.c

index 109fd8d..c885e5f 100644 (file)
@@ -755,6 +755,10 @@ static int lfs_migrate(char *name, __u64 migration_flags,
                goto error;
        }
 
+       /* In case the MDT does not support creation of volatile files
+        * we should try to unlink it. */
+       (void)unlink(volatile_file);
+
        /* Not-owner (root?) special case.
         * Need to set owner/group of volatile file like original.
         * This will allow to pass related check during layout_swap.