mm: make sendfile(2) killable
[pandora-kernel.git] / mm / filemap.c
index 6c009c2..f2f5247 100644 (file)
@@ -2408,6 +2408,11 @@ again:
                        break;
                }
 
                        break;
                }
 
+               if (fatal_signal_pending(current)) {
+                       status = -EINTR;
+                       break;
+               }
+
                status = a_ops->write_begin(file, mapping, pos, bytes, flags,
                                                &page, &fsdata);
                if (unlikely(status))
                status = a_ops->write_begin(file, mapping, pos, bytes, flags,
                                                &page, &fsdata);
                if (unlikely(status))
@@ -2448,10 +2453,6 @@ again:
                written += copied;
 
                balance_dirty_pages_ratelimited(mapping);
                written += copied;
 
                balance_dirty_pages_ratelimited(mapping);
-               if (fatal_signal_pending(current)) {
-                       status = -EINTR;
-                       break;
-               }
        } while (iov_iter_count(i));
 
        return written ? written : status;
        } while (iov_iter_count(i));
 
        return written ? written : status;