2007-05-18 10:35:25

by Miklos Szeredi

[permalink] [raw]
Subject: [patch 1/2] fuse: generic_write_checks() for direct_io

Andrew,

These are for 2.6.22, please apply.

Thanks.

----
From: Miklos Szeredi <[email protected]>

This fixes O_APPEND in direct IO mode. Also checks writes against
file size limits, notably rlimits.

Reported by Greg Bruno.

Signed-off-by: Miklos Szeredi <[email protected]>
---

Index: linux/fs/fuse/file.c
===================================================================
--- linux.orig/fs/fuse/file.c 2007-04-26 12:54:32.000000000 +0200
+++ linux/fs/fuse/file.c 2007-05-02 20:17:27.000000000 +0200
@@ -609,7 +609,9 @@ static ssize_t fuse_direct_write(struct
ssize_t res;
/* Don't allow parallel writes to the same file */
mutex_lock(&inode->i_mutex);
- res = fuse_direct_io(file, buf, count, ppos, 1);
+ res = generic_write_checks(file, ppos, &count, 0);
+ if (!res)
+ res = fuse_direct_io(file, buf, count, ppos, 1);
mutex_unlock(&inode->i_mutex);
return res;
}


2007-05-18 10:36:36

by Miklos Szeredi

[permalink] [raw]
Subject: [patch 2/2] fuse: delete inode on drop

From: Miklos Szeredi <[email protected]>

When inode is dropped (no more references) delete it from cache.

There's not much point in keeping it cached, when a new lookup will
refresh the attributes anyway.

Signed-off-by: Miklos Szeredi <[email protected]>
---

Index: linux/fs/fuse/inode.c
===================================================================
--- linux.orig/fs/fuse/inode.c 2007-05-18 11:32:21.000000000 +0200
+++ linux/fs/fuse/inode.c 2007-05-18 11:47:36.000000000 +0200
@@ -470,6 +470,7 @@ static const struct super_operations fus
.destroy_inode = fuse_destroy_inode,
.read_inode = fuse_read_inode,
.clear_inode = fuse_clear_inode,
+ .drop_inode = generic_delete_inode,
.remount_fs = fuse_remount_fs,
.put_super = fuse_put_super,
.umount_begin = fuse_umount_begin,