diff options
Diffstat (limited to 'fs/sysv/ialloc.c')
-rw-r--r-- | fs/sysv/ialloc.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index 241e9765cfad..0c96c98bd1db 100644 --- a/fs/sysv/ialloc.c +++ b/fs/sysv/ialloc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/stat.h> | 25 | #include <linux/stat.h> |
26 | #include <linux/string.h> | 26 | #include <linux/string.h> |
27 | #include <linux/buffer_head.h> | 27 | #include <linux/buffer_head.h> |
28 | #include <linux/writeback.h> | ||
28 | #include "sysv.h" | 29 | #include "sysv.h" |
29 | 30 | ||
30 | /* We don't trust the value of | 31 | /* We don't trust the value of |
@@ -112,7 +113,6 @@ void sysv_free_inode(struct inode * inode) | |||
112 | return; | 113 | return; |
113 | } | 114 | } |
114 | raw_inode = sysv_raw_inode(sb, ino, &bh); | 115 | raw_inode = sysv_raw_inode(sb, ino, &bh); |
115 | clear_inode(inode); | ||
116 | if (!raw_inode) { | 116 | if (!raw_inode) { |
117 | printk("sysv_free_inode: unable to read inode block on device " | 117 | printk("sysv_free_inode: unable to read inode block on device " |
118 | "%s\n", inode->i_sb->s_id); | 118 | "%s\n", inode->i_sb->s_id); |
@@ -139,6 +139,9 @@ struct inode * sysv_new_inode(const struct inode * dir, mode_t mode) | |||
139 | struct inode *inode; | 139 | struct inode *inode; |
140 | sysv_ino_t ino; | 140 | sysv_ino_t ino; |
141 | unsigned count; | 141 | unsigned count; |
142 | struct writeback_control wbc = { | ||
143 | .sync_mode = WB_SYNC_NONE | ||
144 | }; | ||
142 | 145 | ||
143 | inode = new_inode(sb); | 146 | inode = new_inode(sb); |
144 | if (!inode) | 147 | if (!inode) |
@@ -159,15 +162,7 @@ struct inode * sysv_new_inode(const struct inode * dir, mode_t mode) | |||
159 | *sbi->s_sb_fic_count = cpu_to_fs16(sbi, count); | 162 | *sbi->s_sb_fic_count = cpu_to_fs16(sbi, count); |
160 | fs16_add(sbi, sbi->s_sb_total_free_inodes, -1); | 163 | fs16_add(sbi, sbi->s_sb_total_free_inodes, -1); |
161 | dirty_sb(sb); | 164 | dirty_sb(sb); |
162 | 165 | inode_init_owner(inode, dir, mode); | |
163 | if (dir->i_mode & S_ISGID) { | ||
164 | inode->i_gid = dir->i_gid; | ||
165 | if (S_ISDIR(mode)) | ||
166 | mode |= S_ISGID; | ||
167 | } else | ||
168 | inode->i_gid = current_fsgid(); | ||
169 | |||
170 | inode->i_uid = current_fsuid(); | ||
171 | inode->i_ino = fs16_to_cpu(sbi, ino); | 166 | inode->i_ino = fs16_to_cpu(sbi, ino); |
172 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; | 167 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; |
173 | inode->i_blocks = 0; | 168 | inode->i_blocks = 0; |
@@ -176,8 +171,7 @@ struct inode * sysv_new_inode(const struct inode * dir, mode_t mode) | |||
176 | insert_inode_hash(inode); | 171 | insert_inode_hash(inode); |
177 | mark_inode_dirty(inode); | 172 | mark_inode_dirty(inode); |
178 | 173 | ||
179 | inode->i_mode = mode; /* for sysv_write_inode() */ | 174 | sysv_write_inode(inode, &wbc); /* ensure inode not allocated again */ |
180 | sysv_write_inode(inode, 0); /* ensure inode not allocated again */ | ||
181 | mark_inode_dirty(inode); /* cleared by sysv_write_inode() */ | 175 | mark_inode_dirty(inode); /* cleared by sysv_write_inode() */ |
182 | /* That's it. */ | 176 | /* That's it. */ |
183 | unlock_super(sb); | 177 | unlock_super(sb); |