1 Index: linux-2.6.9/fs/attr.c
2 ===================================================================
3 --- linux-2.6.9/fs.orig/attr.c 2006-03-10 17:20:39.000000000 +0200
4 +++ linux-2.6.9/fs/attr.c 2006-04-09 01:21:44.000000000 +0300
9 + if (ia_valid & ATTR_SIZE)
10 + down_write(&dentry->d_inode->i_alloc_sem);
12 if (inode->i_op && inode->i_op->setattr) {
13 audit_notify_watch(inode, MAY_WRITE);
14 error = security_inode_setattr(dentry, attr);
16 error = inode_setattr(inode, attr);
20 + if (ia_valid & ATTR_SIZE)
21 + up_write(&dentry->d_inode->i_alloc_sem);
24 unsigned long dn_mask = setattr_mask(ia_valid);
26 Index: linux-2.6.9/fs/open.c
27 ===================================================================
28 --- linux-2.6.9/fs.orig/open.c 2006-04-09 01:18:08.000000000 +0300
29 +++ linux-2.6.9/fs/open.c 2006-04-09 01:22:29.000000000 +0300
31 newattrs.ia_size = length;
32 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
33 down(&dentry->d_inode->i_sem);
34 - down_write(&dentry->d_inode->i_alloc_sem);
36 newattrs.ia_valid |= ATTR_FROM_OPEN;
37 if (op->setattr_raw) {
38 newattrs.ia_valid |= ATTR_RAW;
39 newattrs.ia_ctime = CURRENT_TIME;
40 + down_write(&dentry->d_inode->i_alloc_sem);
41 err = op->setattr_raw(dentry->d_inode, &newattrs);
42 + up_write(&dentry->d_inode->i_alloc_sem);
44 err = notify_change(dentry, &newattrs);
45 - up_write(&dentry->d_inode->i_alloc_sem);
46 up(&dentry->d_inode->i_sem);