lkml.org 
[lkml]   [2005]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/5] fuse: request counter overflow fix
From
Date
This patch fixes a signed/unsigned comparison bug found by Franco Broi
after months of filesystem uptime and 2,147,483,648 performed fs
operations.

Since the request identifier is already 64 bits on the userspace ABI,
the counter is now made 64-bit too.

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

diff -rup linux-2.6.13-rc3-mm1/fs/fuse/dev.c linux-fuse/fs/fuse/dev.c
--- linux-2.6.13-rc3-mm1/fs/fuse/dev.c 2005-07-27 09:23:53.000000000 +0200
+++ linux-fuse/fs/fuse/dev.c 2005-07-27 09:29:01.000000000 +0200
@@ -669,7 +671,7 @@ static ssize_t fuse_dev_read(struct file
}

/* Look up request on processing list by unique ID */
-static struct fuse_req *request_find(struct fuse_conn *fc, unsigned unique)
+static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique)
{
struct list_head *entry;

diff -rup linux-2.6.13-rc3-mm1/fs/fuse/fuse_i.h linux-fuse/fs/fuse/fuse_i.h
--- linux-2.6.13-rc3-mm1/fs/fuse/fuse_i.h 2005-07-27 09:23:53.000000000 +0200
+++ linux-fuse/fs/fuse/fuse_i.h 2005-07-27 09:29:01.000000000 +0200
@@ -240,7 +240,7 @@ struct fuse_conn {
struct list_head unused_list;

/** The next unique request id */
- int reqctr;
+ u64 reqctr;

/** Mount is active */
unsigned mounted : 1;
diff -rup linux-2.6.13-rc3-mm1/fs/fuse/inode.c linux-fuse/fs/fuse/inode.c
--- linux-2.6.13-rc3-mm1/fs/fuse/inode.c 2005-07-27 09:23:53.000000000 +0200
+++ linux-fuse/fs/fuse/inode.c 2005-07-27 09:29:01.000000000 +0200
@@ -407,7 +417,7 @@ static struct fuse_conn *new_conn(void)
}
fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
fc->bdi.unplug_io_fn = default_unplug_io_fn;
- fc->reqctr = 1;
+ fc->reqctr = 0;
}
return fc;
}
-
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-07-29 12:58    [W:0.026 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site