[Ocfs2-commits] seeda commits r3027 - branches/ocfs2-1.2/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri May 25 11:25:22 PDT 2007
Author: seeda
Date: 2007-05-25 11:25:21 -0700 (Fri, 25 May 2007)
New Revision: 3027
Modified:
branches/ocfs2-1.2/fs/ocfs2/file.c
Log:
ocfs2: fix to signal ENOSPC during partial allocation
Signed-off-by: smushran
Modified: branches/ocfs2-1.2/fs/ocfs2/file.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/file.c 2007-05-17 07:00:32 UTC (rev 3026)
+++ branches/ocfs2-1.2/fs/ocfs2/file.c 2007-05-25 18:25:21 UTC (rev 3027)
@@ -990,6 +990,8 @@
u64 newsize)
{
u64 bytes_added = 0;
+ u64 actual_size;
+ int tmp_status;
int status;
if (i_size_read(inode) > newsize) {
@@ -1033,11 +1035,13 @@
"status return of %d extending inode "
"%"MLFu64"\n", status,
OCFS2_I(inode)->ip_blkno);
- status = 0;
+
+ actual_size = bytes_added + i_size_read(inode);
+ if ((newsize > actual_size) && (status == 0))
+ status = -ENOSPC;
- newsize = bytes_added + i_size_read(inode);
if (bytes_added)
- ocfs2_update_inode_size(inode, newsize);
+ ocfs2_update_inode_size(inode, actual_size);
#ifdef OCFS2_ORACORE_WORKAROUNDS
spin_lock(&OCFS2_I(inode)->ip_lock);
@@ -1048,9 +1052,12 @@
spin_unlock(&OCFS2_I(inode)->ip_lock);
#endif
+ tmp_status = status;
status = ocfs2_zero_extend(inode);
if (status < 0)
mlog_errno(status);
+ if (tmp_status < 0)
+ status = tmp_status;
out_unlock:
ocfs2_data_unlock(inode, 1);
More information about the Ocfs2-commits
mailing list