lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon,  9 Jun 2008 15:33:04 +0530
From:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	cmm@...ibm.com, tytso@....edu, sandeen@...hat.com
Cc:	linux-ext4@...r.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH v2] ext4: Update i_disksize properly when allocating from fallocate area.

When allocating blocks from an falloc area which was initialized with
FALLOC_FL_KEEP_SIZE we need to extent disksize.

These changes are for code correctness. We do update the i_disksize
in the write_end callback of filesystem properly.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
---
 fs/ext4/extents.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 27cfd30..362211c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2885,7 +2885,10 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
 					ext4_ext_get_actual_len(&newex), 0);
 		goto out2;
 	}
-
+	/* previous routine could use block we allocated */
+	newblock = ext_pblock(&newex);
+	allocated = ext4_ext_get_actual_len(&newex);
+outnew:
 	if (extend_disksize) {
 		disksize = ((loff_t) iblock + ar.len) << inode->i_blkbits;
 		if (disksize > i_size_read(inode))
@@ -2893,11 +2896,6 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
 		if (disksize > EXT4_I(inode)->i_disksize)
 			EXT4_I(inode)->i_disksize = disksize;
 	}
-
-	/* previous routine could use block we allocated */
-	newblock = ext_pblock(&newex);
-	allocated = ext4_ext_get_actual_len(&newex);
-outnew:
 	__set_bit(BH_New, &bh_result->b_state);
 
 	/* Cache only when it is _not_ an uninitialized extent */
-- 
1.5.6.rc2.15.g457bb.dirty

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ