lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 26 Jan 2012 23:01:58 +0100
From:	Jan Kara <jack@...e.cz>
To:	linux-ext4@...r.kernel.org
Cc:	Jan Kara <jack@...e.cz>
Subject: [PATCH] ext2: Replace tests of write IO errors using buffer_uptodate

Signed-off-by: Jan Kara <jack@...e.cz>
---
 fs/ext2/inode.c |    5 ++---
 fs/ext2/xattr.c |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

  I plan to put this minor cleanup into my tree for the next merge window.

diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 740cad8..f832a4c 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1501,11 +1501,10 @@ static int __ext2_write_inode(struct inode *inode, int do_sync)
 		raw_inode->i_block[n] = ei->i_data[n];
 	mark_buffer_dirty(bh);
 	if (do_sync) {
-		sync_dirty_buffer(bh);
-		if (buffer_req(bh) && !buffer_uptodate(bh)) {
+		err = sync_dirty_buffer(bh);
+		if (err) {
 			printk ("IO error syncing ext2 inode [%s:%08lx]\n",
 				sb->s_id, (unsigned long) ino);
-			err = -EIO;
 		}
 	}
 	ei->i_state &= ~EXT2_STATE_NEW;
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 6dcafc7..f3dfb27 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -679,9 +679,8 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
 		}
 		mark_buffer_dirty(new_bh);
 		if (IS_SYNC(inode)) {
-			sync_dirty_buffer(new_bh);
-			error = -EIO;
-			if (buffer_req(new_bh) && !buffer_uptodate(new_bh))
+			error = sync_dirty_buffer(new_bh);
+			if (error)
 				goto cleanup;
 		}
 	}
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists