lkml.org 
[lkml]   [2007]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 02/12] fuse: fix race between getattr and write
On Tue, 02 Oct 2007 17:50:28 +0200
Miklos Szeredi <miklos@szeredi.hu> wrote:

> @@ -228,6 +243,7 @@ static struct dentry *fuse_lookup(struct
> struct fuse_conn *fc = get_fuse_conn(dir);
> struct fuse_req *req;
> struct fuse_req *forget_req;
> + u64 attr_version;
>
> if (entry->d_name.len > FUSE_NAME_MAX)
> return ERR_PTR(-ENAMETOOLONG);
> @@ -242,6 +258,10 @@ static struct dentry *fuse_lookup(struct
> return ERR_PTR(PTR_ERR(forget_req));
> }
>
> + spin_lock(&fc->lock);
> + attr_version = fc->attr_version;
> + spin_unlock(&fc->lock);

You might want to do this (oft-repeated) operation in a little helper
function.

Because I suspect that the lock isn't needed if CONFIG_64BIT=y.
-
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: 2007-10-05 00:47    [W:0.086 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site