Skip to content

Commit

Permalink
udf: Do not read inode before writing it
Browse files Browse the repository at this point in the history
We needlessly read inode in udf_update_inode just before zeroing out the
contents of the buffer. Fix it.

Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Jan Kara committed Mar 9, 2010
1 parent aae917c commit 5833ded
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/udf/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,9 +1408,8 @@ static int udf_update_inode(struct inode *inode, int do_sync)
unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
struct udf_inode_info *iinfo = UDF_I(inode);

bh = udf_tread(inode->i_sb,
udf_get_lb_pblock(inode->i_sb,
&iinfo->i_location, 0));
bh = udf_tgetblk(inode->i_sb,
udf_get_lb_pblock(inode->i_sb, &iinfo->i_location, 0));
if (!bh) {
udf_debug("getblk failure\n");
return -ENOMEM;
Expand Down Expand Up @@ -1602,6 +1601,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag);

out:
set_buffer_uptodate(bh);
unlock_buffer(bh);

/* write the data blocks */
Expand Down

0 comments on commit 5833ded

Please sign in to comment.