diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-31 22:30:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-31 22:30:48 -0500 |
commit | fa3c791d85aa9a363dd72dd834b73b79252ef44e (patch) | |
tree | 082505d99fd937a818e36667a506dd2389a4f864 /fs | |
parent | bd3f8f2b12bcf4ea25c89b84adeaafad232662c8 (diff) | |
parent | fad3aa1e8e2e4123a19b926fefd91ec63dd56497 (diff) |
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 7 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 50 |
2 files changed, 39 insertions, 18 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index e44b7c1a3a36..a36a8e3b703f 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -822,6 +822,13 @@ xfs_buf_rele( | |||
822 | 822 | ||
823 | XB_TRACE(bp, "rele", bp->b_relse); | 823 | XB_TRACE(bp, "rele", bp->b_relse); |
824 | 824 | ||
825 | if (unlikely(!hash)) { | ||
826 | ASSERT(!bp->b_relse); | ||
827 | if (atomic_dec_and_test(&bp->b_hold)) | ||
828 | xfs_buf_free(bp); | ||
829 | return; | ||
830 | } | ||
831 | |||
825 | if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { | 832 | if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { |
826 | if (bp->b_relse) { | 833 | if (bp->b_relse) { |
827 | atomic_inc(&bp->b_hold); | 834 | atomic_inc(&bp->b_hold); |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 76c6df34d0db..eda7919b70a1 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -262,6 +262,31 @@ has_fs_struct(struct task_struct *task) | |||
262 | return (task->fs != init_task.fs); | 262 | return (task->fs != init_task.fs); |
263 | } | 263 | } |
264 | 264 | ||
265 | STATIC inline void | ||
266 | cleanup_inode( | ||
267 | vnode_t *dvp, | ||
268 | vnode_t *vp, | ||
269 | struct dentry *dentry, | ||
270 | int mode) | ||
271 | { | ||
272 | struct dentry teardown = {}; | ||
273 | int err2; | ||
274 | |||
275 | /* Oh, the horror. | ||
276 | * If we can't add the ACL or we fail in | ||
277 | * linvfs_init_security we must back out. | ||
278 | * ENOSPC can hit here, among other things. | ||
279 | */ | ||
280 | teardown.d_inode = LINVFS_GET_IP(vp); | ||
281 | teardown.d_name = dentry->d_name; | ||
282 | |||
283 | if (S_ISDIR(mode)) | ||
284 | VOP_RMDIR(dvp, &teardown, NULL, err2); | ||
285 | else | ||
286 | VOP_REMOVE(dvp, &teardown, NULL, err2); | ||
287 | VN_RELE(vp); | ||
288 | } | ||
289 | |||
265 | STATIC int | 290 | STATIC int |
266 | linvfs_mknod( | 291 | linvfs_mknod( |
267 | struct inode *dir, | 292 | struct inode *dir, |
@@ -316,30 +341,19 @@ linvfs_mknod( | |||
316 | } | 341 | } |
317 | 342 | ||
318 | if (!error) | 343 | if (!error) |
344 | { | ||
319 | error = linvfs_init_security(vp, dir); | 345 | error = linvfs_init_security(vp, dir); |
346 | if (error) | ||
347 | cleanup_inode(dvp, vp, dentry, mode); | ||
348 | } | ||
320 | 349 | ||
321 | if (default_acl) { | 350 | if (default_acl) { |
322 | if (!error) { | 351 | if (!error) { |
323 | error = _ACL_INHERIT(vp, &va, default_acl); | 352 | error = _ACL_INHERIT(vp, &va, default_acl); |
324 | if (!error) { | 353 | if (!error) |
325 | VMODIFY(vp); | 354 | VMODIFY(vp); |
326 | } else { | 355 | else |
327 | struct dentry teardown = {}; | 356 | cleanup_inode(dvp, vp, dentry, mode); |
328 | int err2; | ||
329 | |||
330 | /* Oh, the horror. | ||
331 | * If we can't add the ACL we must back out. | ||
332 | * ENOSPC can hit here, among other things. | ||
333 | */ | ||
334 | teardown.d_inode = ip = LINVFS_GET_IP(vp); | ||
335 | teardown.d_name = dentry->d_name; | ||
336 | |||
337 | if (S_ISDIR(mode)) | ||
338 | VOP_RMDIR(dvp, &teardown, NULL, err2); | ||
339 | else | ||
340 | VOP_REMOVE(dvp, &teardown, NULL, err2); | ||
341 | VN_RELE(vp); | ||
342 | } | ||
343 | } | 357 | } |
344 | _ACL_FREE(default_acl); | 358 | _ACL_FREE(default_acl); |
345 | } | 359 | } |