[PATCH 16/52] CRED: Pass credentials through the internals of ext3 truncation

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

 



Pass credentials through the internals of ext3 truncation.

Signed-off-by: David Howells <[email protected]>
---

 fs/ext3/inode.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 73b64f3..4313d20 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1770,9 +1770,8 @@ void ext3_set_aops(struct inode *inode)
  * of that block so it doesn't yield old data if the file is later grown.
  */
 static int ext3_block_truncate_page(handle_t *handle, struct page *page,
-		struct address_space *mapping, loff_t from)
+		struct address_space *mapping, loff_t from, struct cred *cred)
 {
-	struct cred *cred = current->cred;
 	ext3_fsblk_t index = from >> PAGE_CACHE_SHIFT;
 	unsigned offset = from & (PAGE_CACHE_SIZE-1);
 	unsigned blocksize, iblock, length, pos;
@@ -2230,6 +2229,7 @@ static void ext3_free_branches(handle_t *handle, struct inode *inode,
  */
 void ext3_truncate(struct inode *inode)
 {
+	struct cred *cred = current->cred;
 	handle_t *handle;
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	__le32 *i_data = ei->i_data;
@@ -2281,7 +2281,8 @@ void ext3_truncate(struct inode *inode)
 					>> EXT3_BLOCK_SIZE_BITS(inode->i_sb);
 
 	if (page)
-		ext3_block_truncate_page(handle, page, mapping, inode->i_size);
+		ext3_block_truncate_page(handle, page, mapping, inode->i_size,
+					 cred);
 
 	n = ext3_block_to_path(inode, last_block, offsets, NULL);
 	if (n == 0)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux