aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-01-08 10:52:59 -0500
committerJan Kara <jack@suse.cz>2010-03-09 11:15:17 -0500
commit5833ded9b6d783b8446349bada08f0f5e4227895 (patch)
tree6f86b88c0c446b4c62cd38b8cd9f4432331216f6
parentaae917cd188f397e9223001d9f6c0adfb339fd64 (diff)
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: Jan Kara <jack@suse.cz>
-rw-r--r--fs/udf/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index a792a884b49c..a00602b2e32d 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1408,9 +1408,8 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1408 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; 1408 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
1409 struct udf_inode_info *iinfo = UDF_I(inode); 1409 struct udf_inode_info *iinfo = UDF_I(inode);
1410 1410
1411 bh = udf_tread(inode->i_sb, 1411 bh = udf_tgetblk(inode->i_sb,
1412 udf_get_lb_pblock(inode->i_sb, 1412 udf_get_lb_pblock(inode->i_sb, &iinfo->i_location, 0));
1413 &iinfo->i_location, 0));
1414 if (!bh) { 1413 if (!bh) {
1415 udf_debug("getblk failure\n"); 1414 udf_debug("getblk failure\n");
1416 return -ENOMEM; 1415 return -ENOMEM;
@@ -1602,6 +1601,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1602 fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag); 1601 fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag);
1603 1602
1604out: 1603out:
1604 set_buffer_uptodate(bh);
1605 unlock_buffer(bh); 1605 unlock_buffer(bh);
1606 1606
1607 /* write the data blocks */ 1607 /* write the data blocks */