Skip to contentSkip to conversation

add notify trunctpage to close file

PATCH New Ling 2 participants 2 messages Jul 6, 2004 OCFS2

lore
Share & tools
lore

Ling

#0 lore raw

PATCH 1/1 add notify trunctpage to close file

It is reasonable to notify other node when closing file. It is reasonable to notify other node when closing file. It ensures other node can get the newest data after the write finish,

-------------------------------------------

dlm.c +0 -1
Index: dlm.c
===================================================================
@@ -732,7 +732,7 @@
  * ocfs_notify_truncate_on_wopen()
  * inode is definitely non NULL
  */
-int ocfs_notify_truncate_on_wopen (ocfs_super * osb, struct inode

*inode)
+int ocfs_notify_truncate_on_write (ocfs_super * osb, struct inode *inode)
{
int status = -EAGAIN;
int disk_vote = 0;
@@ -774,7 +774,7 @@
bail:
LOG_EXIT_STATUS (status);
return status;
-} /* ocfs_notify_truncate_on_wopen */
+} /* ocfs_notify_truncate_on_write */

enum {
invalid_path = 0,

file.c +2 -0
Index: file.c
===================================================================
@@ -341,6 +341,7 @@
 	struct dentry *dentry;
 	int last_close = 0;
 	int dec = 0;
+	int status;
 
 	LOG_SET_CONTEXT(RELEASE);
 
@@ -394,6 +395,13 @@
 		spin_unlock(&oin_num_ext_lock);
 		up(&recovery_list_sem);
 	}
+	if (file->f_flags & (O_WRONLY|O_RDWR) && !(file->f_flags &

O_DIRECT)) {
+ status = ocfs_notify_truncate_on_write(osb, inode);
+ if (status < 0) {
+ LOG_ERROR_STATUS(status);
+ }
+ }
+
up (&(OCFS_I(inode)->ip_sem));
ocfs_sync_inode(inode);

#1 lore raw

PATCH 1/1 add notify trunctpage to close file

Quoted 1 line

ocfs_sync_inode(inode);

euhm I think we should not be doing a sync inode on every file release. could explain the perofmrance degradation on install/untar