[patch] might_sleep() additions to fs-writeback.c

Ingo Molnar
2004-09-14T11:12:04Z

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

add two more might_sleep() checks: to sync_inode() and
generic_osync_inode().

Signed-off-by: Ingo Molnar <mingo@elte.hu>

--- linux/fs/fs-writeback.c.orig
+++ linux/fs/fs-writeback.c
@@ -578,6 +578,7 @@ int sync_inode(struct inode *inode, stru
{
int ret;

+ might_sleep();
spin_lock(&inode_lock);
ret = __writeback_single_inode(inode, wbc);
spin_unlock(&inode_lock);
@@ -622,6 +623,7 @@ int generic_osync_inode(struct inode *in
}
current->flags &= ~PF_SYNCWRITE;

+ might_sleep();
spin_lock(&inode_lock);
if ((inode->i_state & I_DIRTY) &&
((what & OSYNC_INODE) || (inode->i_state & I_DIRTY_DATASYNC)))

[-- Attachment #2: might_sleep-fs-writeback.patch --]
[-- Type: text/plain, Size: 631 bytes --]

add two more might_sleep() checks: to sync_inode() and
generic_osync_inode().

Signed-off-by: Ingo Molnar <mingo@elte.hu>

--- linux/fs/fs-writeback.c.orig
+++ linux/fs/fs-writeback.c
@@ -578,6 +578,7 @@ int sync_inode(struct inode *inode, stru
{
int ret;

+ might_sleep();
spin_lock(&inode_lock);
ret = __writeback_single_inode(inode, wbc);
spin_unlock(&inode_lock);
@@ -622,6 +623,7 @@ int generic_osync_inode(struct inode *in
}
current->flags &= ~PF_SYNCWRITE;

+ might_sleep();
spin_lock(&inode_lock);
if ((inode->i_state & I_DIRTY) &&
((what & OSYNC_INODE) || (inode->i_state & I_DIRTY_DATASYNC)))