From: Miklos Szeredi <miklos@szeredi.hu>

This patch fixes an Oops which happens when nfsd calls fsync on a directory
with a NULL file argument.  The solution is to just ignore the fsync.  Thanks
to David Shaw for the bugreport.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/fuse/dir.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/fuse/dir.c~fuse-add-fsync-operation-for-directories-fix fs/fuse/dir.c
--- 25/fs/fuse/dir.c~fuse-add-fsync-operation-for-directories-fix	2005-05-10 02:22:18.000000000 -0700
+++ 25-akpm/fs/fuse/dir.c	2005-05-10 02:22:18.000000000 -0700
@@ -617,7 +617,8 @@ static int fuse_dir_release(struct inode
 
 static int fuse_dir_fsync(struct file *file, struct dentry *de, int datasync)
 {
-	return fuse_fsync_common(file, de, datasync, 1);
+	/* nfsd can call this with no file */
+	return file ? fuse_fsync_common(file, de, datasync, 1) : 0;
 }
 
 static unsigned iattr_to_fattr(struct iattr *iattr, struct fuse_attr *fattr)
_