Skip to contentSkip to conversation

coda: Remove CODA_STORE/CODA_RELEASE upcalls

PATCH New Jan Harkes 1 participant 1 message Jul 20, 2007

Subsystems (2)
lore
Share & tools
lore

Jan Harkes

author maintainer
#0 lore raw

PATCH 1/1 coda: Remove CODA_STORE/CODA_RELEASE upcalls

This is an variation on the patch sent by Christoph Hellwig which kills file_count abuse by the Coda kernel module by moving the coda_flush functionality into coda_release. However part of reason we were using the coda_flush callback was to allow Coda to pass errors that occur during writeback from the userspace cache manager back to close().

As Al Viro explained on linux-fsdevel, it is impossible to guarantee that such errors can in fact be returned back to the caller. There are many cases where the last reference to a file is not released by the close system call and it is also impossible to pick some close as a 'last-close' and delay it until all other references have been destroyed.

The CODA_STORE/CODA_RELEASE upcall combination is clearly a broken design, and it is better to remove it completely.

Cc Christoph Hellwig <[email protected]>
Cc Al Viro <[email protected]>
---
 fs/coda/dir.c              |    1 -
 fs/coda/file.c             |   65 ++++---------------------------------------
 fs/coda/upcall.c           |   49 +--------------------------------
 include/linux/coda_linux.h |    1 -
 include/linux/coda_psdev.h |    3 --
 5 files changed, 7 insertions(+), 112 deletions(-)
fs/coda/dir.c +0 -1
index 8e61236..f89ff08 100644
@@ -86,7 +86,6 @@ const struct file_operations coda_dir_operations = {
 	.read		= generic_read_dir,
 	.readdir	= coda_readdir,
 	.open		= coda_open,
-	.flush		= coda_flush,
 	.release	= coda_release,
 	.fsync		= coda_fsync,
 };
fs/coda/file.c +6 -59

98 lines not on this page · raw message

fs/coda/upcall.c +1 -48

56 lines not on this page · raw message

include/linux/coda_linux.h +0 -1
index c4079b4..1c47a34 100644
@@ -36,7 +36,6 @@ extern const struct file_operations coda_ioctl_operations;
 
 /* operations shared over more than one file */
 int coda_open(struct inode *i, struct file *f);
-int coda_flush(struct file *f, fl_owner_t id);
 int coda_release(struct inode *i, struct file *f);
 int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
 int coda_revalidate_inode(struct dentry *);
include/linux/coda_psdev.h +0 -3
index aa8f454..07ae8f8 100644
@@ -33,9 +33,6 @@ int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
 int venus_lookup(struct super_block *sb, struct CodaFid *fid, 
 		 const char *name, int length, int *type, 
 		 struct CodaFid *resfid);
-int venus_store(struct super_block *sb, struct CodaFid *fid, int flags,
-		vuid_t uid);
-int venus_release(struct super_block *sb, struct CodaFid *fid, int flags);
 int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
 		vuid_t uid);
 int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
Signature · 1 line
1.5.2.1