[PATCH 3/7] vfs: do not allow inode_setattr() to fail after vfs_dq_transfer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux