lkml.org 
[lkml]   [2007]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 16/52] CRED: Pass credentials through the internals of ext3 truncation
    Date
    Pass credentials through the internals of ext3 truncation.

    Signed-off-by: David Howells <dhowells@redhat.com>
    ---

    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 majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-12 18:17    [W:4.721 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site