patch-2.1.129 linux/kernel/acct.c

Next file: linux/kernel/printk.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.128/linux/kernel/acct.c linux/kernel/acct.c
@@ -273,6 +273,7 @@
 	struct acct ac;
 	mm_segment_t fs;
 	unsigned long vsize;
+	struct inode *inode;
 
 	/*
 	 * First check to see if there is enough free_space to continue
@@ -336,8 +337,11 @@
          */
 	fs = get_fs();
 	set_fs(KERNEL_DS);
+	inode = file->f_dentry->d_inode;
+	down(&inode->i_sem);
 	file->f_op->write(file, (char *)&ac,
 			       sizeof(struct acct), &file->f_pos);
+	up(&inode->i_sem);
 	set_fs(fs);
 	fput(file);
 	return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov