lkml.org 
[lkml]   [2005]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] FUSE: fix locking for background list
From
Date
Hi Andrew!

In the prevous fix (fix busy inodes after unmount) I forgot to protect
against concurrent modification of the background list. This patch
adds the necessary locking.

Next time I'll think before sending.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>

diff -rup linux-2.6.12-rc1-mm1/fs/fuse/dev.c linux-fuse/fs/fuse/dev.c
--- linux-2.6.12-rc1-mm1/fs/fuse/dev.c 2005-03-21 13:34:42.000000000 +0100
+++ linux-fuse/fs/fuse/dev.c 2005-03-21 13:35:30.000000000 +0100
@@ -148,7 +148,9 @@ void fuse_release_background(struct fuse
iput(req->inode2);
if (req->file)
fput(req->file);
+ spin_lock(&fuse_lock);
list_del(&req->bg_entry);
+ spin_unlock(&fuse_lock);
}

/* Called with fuse_lock, unlocks it */
@@ -324,7 +326,9 @@ void request_send_noreply(struct fuse_co
void request_send_background(struct fuse_conn *fc, struct fuse_req *req)
{
req->isreply = 1;
+ spin_lock(&fuse_lock);
background_request(fc, req);
+ spin_unlock(&fuse_lock);
request_send_nowait(fc, req);
}

diff -rup linux-2.6.12-rc1-mm1/fs/fuse/fuse_i.h linux-fuse/fs/fuse/fuse_i.h
--- linux-2.6.12-rc1-mm1/fs/fuse/fuse_i.h 2005-03-21 13:34:42.000000000 +0100
+++ linux-fuse/fs/fuse/fuse_i.h 2005-03-21 13:35:30.000000000 +0100
@@ -301,6 +301,7 @@ extern struct file_operations fuse_dev_o
* - the private_data field of the device file
* - the s_fs_info field of the super block
* - unused_list, pending, processing lists in fuse_conn
+ * - background list in fuse_conn
* - the unique request ID counter reqctr in fuse_conn
* - the sb (super_block) field in fuse_conn
* - the file (device file) field in fuse_conn
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.038 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site