ext4: Fix buffer head leaks after calls to ext4_get_inode_loc()

Calls to ext4_get_inode_loc() returns with a reference to a buffer
head in iloc->bh. The callers of this function in ext4_write_inode()
when in no journal mode and in ext4_xattr_fiemap() don't release the
buffer head after using it.

Addresses-Google-Bug: #2548165

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

authored by Curt Wohlgemuth and committed by Theodore Ts'o fd2dd9fb 8b472d73

+2
+1
fs/ext4/extents.c
··· 3879 3879 physical += offset; 3880 3880 length = EXT4_SB(inode->i_sb)->s_inode_size - offset; 3881 3881 flags |= FIEMAP_EXTENT_DATA_INLINE; 3882 + brelse(iloc.bh); 3882 3883 } else { /* external block */ 3883 3884 physical = EXT4_I(inode)->i_file_acl << blockbits; 3884 3885 length = inode->i_sb->s_blocksize;
+1
fs/ext4/inode.c
··· 5385 5385 (unsigned long long)iloc.bh->b_blocknr); 5386 5386 err = -EIO; 5387 5387 } 5388 + brelse(iloc.bh); 5388 5389 } 5389 5390 return err; 5390 5391 }