shithub: lwext4

Download patch

ref: 1cf71b8e4ad525d575ae130a658b02f67f5cc495
parent: 9fdd0b708e0068d6c0be75b7e3df7bbdb7d1d236
author: Kaho Ng <[email protected]>
date: Sun May 15 21:49:26 EDT 2016

ext4_xattr: invalidate the block buffer when writing fails

--- a/src/ext4_xattr.c
+++ b/src/ext4_xattr.c
@@ -1001,8 +1001,11 @@
 
 void ext4_fs_put_xattr_ref(struct ext4_xattr_ref *ref)
 {
-	ext4_xattr_write_to_disk(ref);
+	int rc = ext4_xattr_write_to_disk(ref);
 	if (ref->block_loaded) {
+		if (rc != EOK)
+			ext4_bcache_clear_dirty(ref->block.buf);
+
 		ext4_block_set(ref->fs->bdev, &ref->block);
 		ref->block_loaded = false;
 	}