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/

Reply via email to