Commit 5833ded9 authored by Jan Kara's avatar Jan Kara

udf: Do not read inode before writing it

We needlessly read inode in udf_update_inode just before zeroing out the
contents of the buffer. Fix it.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent aae917cd
...@@ -1408,9 +1408,8 @@ static int udf_update_inode(struct inode *inode, int do_sync) ...@@ -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; unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
struct udf_inode_info *iinfo = UDF_I(inode); struct udf_inode_info *iinfo = UDF_I(inode);
bh = udf_tread(inode->i_sb, bh = udf_tgetblk(inode->i_sb,
udf_get_lb_pblock(inode->i_sb, udf_get_lb_pblock(inode->i_sb, &iinfo->i_location, 0));
&iinfo->i_location, 0));
if (!bh) { if (!bh) {
udf_debug("getblk failure\n"); udf_debug("getblk failure\n");
return -ENOMEM; return -ENOMEM;
...@@ -1602,6 +1601,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) ...@@ -1602,6 +1601,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag); fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag);
out: out:
set_buffer_uptodate(bh);
unlock_buffer(bh); unlock_buffer(bh);
/* write the data blocks */ /* write the data blocks */
......
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