OSDN Git Service

mm, thp: respect MPOL_PREFERRED policy with non-local node
[android-x86/kernel.git] / fs / coredump.c
index b5c86ff..bbbe139 100644 (file)
@@ -572,7 +572,7 @@ void do_coredump(const siginfo_t *siginfo)
                         *
                         * Normally core limits are irrelevant to pipes, since
                         * we're not writing to the file system, but we use
-                        * cprm.limit of 1 here as a speacial value, this is a
+                        * cprm.limit of 1 here as a special value, this is a
                         * consistent way to catch recursive crashes.
                         * We can still crash if the core_pattern binary sets
                         * RLIM_CORE = !1, but it runs as root, and can do
@@ -657,7 +657,7 @@ void do_coredump(const siginfo_t *siginfo)
                 */
                if (!uid_eq(inode->i_uid, current_fsuid()))
                        goto close_fail;
-               if (!cprm.file->f_op->write)
+               if (!(cprm.file->f_mode & FMODE_CAN_WRITE))
                        goto close_fail;
                if (do_truncate(cprm.file->f_path.dentry, 0, 0, cprm.file))
                        goto close_fail;