udf: Do not read inode before writing it
authorJan Kara <jack@suse.cz>
Fri, 8 Jan 2010 15:52:59 +0000 (16:52 +0100)
committerJan Kara <jack@suse.cz>
Tue, 9 Mar 2010 16:15:17 +0000 (17:15 +0100)
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>
fs/udf/inode.c

index a792a884b49cb1c9225ba084ecf575eed92f93e8..a00602b2e32d8dd3e4485c9476b200fbfab865ec 100644 (file)
@@ -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;
@@ -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 */