Skip to contentSkip to conversation

FUSE: nfsd directory fsync fix

PATCH New Miklos Szeredi 1 participant 1 message Apr 24, 2005 FUSE filesystem core

lore
Share & tools
lore

Miklos Szeredi

author maintainer
#0 lore raw

PATCH 1/1 FUSE: nfsd directory fsync fix

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.

fs/fuse/dir.c +2 -1
diff -rup linux-2.6.12-rc2-mm3/fs/fuse/dir.c linux-fuse/fs/fuse/dir.c
@@ -590,7 +590,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)