Btrfs: don't walk around with task->state != TASK_RUNNING
[deliverable/linux.git] / include / linux / coredump.h
index b3c91d7cede4e764cb5a62700e5900987aa3e0eb..8ba66a9d9022c7d0ddbbcb984b8839dabb2b91f8 100644 (file)
@@ -16,6 +16,8 @@ static inline int dump_write(struct file *file, const void *addr, int nr)
 
 static inline int dump_seek(struct file *file, loff_t off)
 {
+       int ret = 1;
+
        if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
                if (file->f_op->llseek(file, off, SEEK_CUR) < 0)
                        return 0;
@@ -29,13 +31,15 @@ static inline int dump_seek(struct file *file, loff_t off)
 
                        if (n > PAGE_SIZE)
                                n = PAGE_SIZE;
-                       if (!dump_write(file, buf, n))
-                               return 0;
+                       if (!dump_write(file, buf, n)) {
+                               ret = 0;
+                               break;
+                       }
                        off -= n;
                }
                free_page((unsigned long)buf);
        }
-       return 1;
+       return ret;
 }
 
 #endif /* _LINUX_COREDUMP_H */
This page took 0.028241 seconds and 5 git commands to generate.