ocfs2: cond_resched() in ocfs2_zero_extend()
authorMark Fasheh <mark.fasheh@oracle.com>
Wed, 4 Oct 2006 00:53:05 +0000 (17:53 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Fri, 20 Oct 2006 22:27:48 +0000 (15:27 -0700)
The loop within ocfs2_zero_extend() can execute for a long time, causing
spurious soft lockup warnings.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/file.c

index b499c32..1be74c4 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
 #include <linux/uio.h>
+#include <linux/sched.h>
 
 #define MLOG_MASK_PREFIX ML_INODE
 #include <cluster/masklog.h>
@@ -691,6 +692,12 @@ static int ocfs2_zero_extend(struct inode *inode,
                }
 
                start_off += sb->s_blocksize;
+
+               /*
+                * Very large extends have the potential to lock up
+                * the cpu for extended periods of time.
+                */
+               cond_resched();
        }
 
 out: