[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1IdZZp-0002Xp-00@dorka.pomaz.szeredi.hu>
Date: Fri, 05 Oct 2007 00:53:53 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: akpm@...ux-foundation.org
CC: miklos@...redi.hu, linux-kernel@...r.kernel.org,
jakub.bogusz@...ius.pl
Subject: Re: [patch 02/12] fuse: fix race between getattr and write
> > @@ -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.
You're perfectly right, although fuse is not yet at the stage, where
I'd bother too much with scalability optimizations like that ;)
But it's a good cleanup, and I'll do an incremental patch on top of
this if that's OK.
Miklos
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists