Merge tag 'for_v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
[linux-2.6-microblaze.git] / fs / coredump.c
index 0cd9056..a2f6ecc 100644 (file)
@@ -229,7 +229,8 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm,
                 */
                if (ispipe) {
                        if (isspace(*pat_ptr)) {
-                               was_space = true;
+                               if (cn->used != 0)
+                                       was_space = true;
                                pat_ptr++;
                                continue;
                        } else if (was_space) {
@@ -585,7 +586,6 @@ void do_coredump(const kernel_siginfo_t *siginfo)
        int ispipe;
        size_t *argv = NULL;
        int argc = 0;
-       struct files_struct *displaced;
        /* require nonrelative corefile path and be extra careful */
        bool need_suid_safe = false;
        bool core_dumped = false;
@@ -791,11 +791,10 @@ void do_coredump(const kernel_siginfo_t *siginfo)
        }
 
        /* get us an unshared descriptor table; almost always a no-op */
-       retval = unshare_files(&displaced);
+       /* The cell spufs coredump code reads the file descriptor tables */
+       retval = unshare_files();
        if (retval)
                goto close_fail;
-       if (displaced)
-               put_files_struct(displaced);
        if (!dump_interrupted()) {
                /*
                 * umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would