Skip to contentSkip to conversation

udf: block-based fs should use generic_write_end()

PATCH In review Taesoo Kim 2 participants 2 messages Mar 20, 2015 – Apr 1, 2015 UDF filesystem

lore
Share & tools
lore

Taesoo Kim

author
#0 lore raw

PATCH 1/1 udf: block-based fs should use generic_write_end()

simple_write_end() is for non-block fs, which doesn't invoke mark_inode_dirty(). Instead, generic_write_end() correctly handles such case when i_size has changed.

---
 fs/udf/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/udf/file.c +1 -1
index 08f3555..28b1dab 100644
@@ -112,7 +112,7 @@ const struct address_space_operations udf_adinicb_aops = {
 	.readpage	= udf_adinicb_readpage,
 	.writepage	= udf_adinicb_writepage,
 	.write_begin	= udf_adinicb_write_begin,
-	.write_end	= simple_write_end,
+	.write_end	= generic_write_end,
 	.direct_IO	= udf_adinicb_direct_IO,
 };
 
Signature · 1 line
2.3.3
#1 lore raw
Quoted 5 lines · Taesoo Kim

simple_write_end() is for non-block fs, which doesn't invoke mark_inode_dirty(). Instead, generic_write_end() correctly handles such case when i_size has changed.

So simple_write_end() is actually correct in that place. We cannot even
use generic_write_end() because that page doesn't have buffers attached - it's a special case of a file which is smaller than a block and is packed in the inode. Please test the patch better next time - this would oops on you the first time you try to write to such a file. Thanks!

Honza

Quoted 20 lines
---
 fs/udf/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/udf/file.c +1 -1
index 08f3555..28b1dab 100644
@@ -112,7 +112,7 @@ const struct address_space_operations udf_adinicb_aops = {
 	.readpage	= udf_adinicb_readpage,
 	.writepage	= udf_adinicb_writepage,
 	.write_begin	= udf_adinicb_write_begin,
-	.write_end	= simple_write_end,
+	.write_end	= generic_write_end,
 	.direct_IO	= udf_adinicb_direct_IO,
 };
 
Signature · 1 line
2.3.3
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR