patch-2.4.7 linux/fs/sysv/dir.c

Next file: linux/fs/sysv/ialloc.c
Previous file: linux/fs/reiserfs/stree.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/fs/sysv/dir.c linux/fs/sysv/dir.c
@@ -40,6 +40,8 @@
 {
 	struct inode *dir = (struct inode *)page->mapping->host;
 	int err = 0;
+
+	dir->i_version = ++event;
 	page->mapping->a_ops->commit_write(NULL, page, from, to);
 	if (IS_SYNC(dir))
 		err = waitfor_one_page(page);
@@ -109,6 +111,7 @@
 
 done:
 	filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
+	filp->f_version = inode->i_version;
 	UPDATE_ATIME(inode);
 	return 0;
 }
@@ -211,7 +214,7 @@
 	if (err)
 		goto out_unlock;
 	memcpy (de->name, name, namelen);
-	memset (de->name + namelen, 0, SYSV_DIRSIZE - namelen);
+	memset (de->name + namelen, 0, SYSV_DIRSIZE - namelen - 2);
 	de->inode = cpu_to_fs16(inode->i_sb, inode->i_ino);
 	err = dir_commit_chunk(page, from, to);
 	dir->i_mtime = dir->i_ctime = CURRENT_TIME;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)