lkml.org 
[lkml]   [2010]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/7] vfs: do not allow inode_setattr() to fail after vfs_dq_transfer()
Date
After quota was transfered, inode_setattr() may fail. This
is tricky situation because it may be impossible to
roll-back quota changes. But we have already done all
necessery changes in inode_change_ok() so it is safe to
use nofail version of inode_seattr() here.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/attr.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index cc2a801..c1ae61c 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -243,7 +243,11 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
error = vfs_dq_transfer(inode, attr) ?
-EDQUOT : 0;
if (!error)
- error = inode_setattr(inode, attr);
+ /*
+ * All necessery check already done, it is
+ * safe to use nofail version here.
+ */
+ __inode_setattr(inode, attr);
}
}

--
1.6.6


\
 
 \ /
  Last update: 2010-02-19 20:51    [W:0.066 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site