Commit f9346132 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] udf: fix reservation discarding

UDF discards file preallocations on every ->put_inode which is totally
bogus.  It already discards them in ->release which makes sense for normal
writes, so the only additional discard is in ->clear_inode so we make sure
we don't leak any reservations for shared writeable mappings.

This follows similar changes to ext2 and ext3.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 55521f50
......@@ -69,30 +69,6 @@ static void udf_update_extents(struct inode *,
kernel_lb_addr, uint32_t, struct buffer_head **);
static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int);
/*
* udf_put_inode
*
* PURPOSE
*
* DESCRIPTION
* This routine is called whenever the kernel no longer needs the inode.
*
* HISTORY
* July 1, 1997 - Andrew E. Mileski
* Written, tested, and released.
*
* Called at each iput()
*/
void udf_put_inode(struct inode * inode)
{
if (!(inode->i_sb->s_flags & MS_RDONLY))
{
lock_kernel();
udf_discard_prealloc(inode);
unlock_kernel();
}
}
/*
* udf_delete_inode
*
......@@ -129,6 +105,12 @@ void udf_delete_inode(struct inode * inode)
void udf_clear_inode(struct inode *inode)
{
if (!(inode->i_sb->s_flags & MS_RDONLY)) {
lock_kernel();
udf_discard_prealloc(inode);
unlock_kernel();
}
kfree(UDF_I_DATA(inode));
UDF_I_DATA(inode) = NULL;
}
......
......@@ -163,7 +163,6 @@ static struct super_operations udf_sb_ops = {
.alloc_inode = udf_alloc_inode,
.destroy_inode = udf_destroy_inode,
.write_inode = udf_write_inode,
.put_inode = udf_put_inode,
.delete_inode = udf_delete_inode,
.clear_inode = udf_clear_inode,
.put_super = udf_put_super,
......
......@@ -96,7 +96,6 @@ extern struct buffer_head * udf_expand_dir_adinicb(struct inode *, int *, int *)
extern struct buffer_head * udf_bread(struct inode *, int, int, int *);
extern void udf_truncate(struct inode *);
extern void udf_read_inode(struct inode *);
extern void udf_put_inode(struct inode *);
extern void udf_delete_inode(struct inode *);
extern void udf_clear_inode(struct inode *);
extern int udf_write_inode(struct inode *, int);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment