Re: [PATCH] Silence warnings about non-uptodate buffers

Jan Kara
2008-05-28T22:07:00Z

On Wed 28-05-08 23:56:08, Jan Kara wrote:
> Hello,
>
> the series of patches below gets rid of warning messages in mark_buffer_dirty()
> when underlying block device becomes unavailable. Andrew, would you merge them
> please?
>
And just for reference a similar patch for UDF which I'll merge through
my git tree.

Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
---

>From 756bc361a065b65df9977c2632472f587659a6f7 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Wed, 28 May 2008 23:39:19 +0200
Subject: [PATCH] udf: Silence warnings about non-uptodate buffers

When underlying block device becomes unavailable (e.g. someone pulling an
USB stick from under us), kernel produces warning about non-uptodate buffer
(superblock) being marked dirty. Silence these warnings by making buffer
uptodate before marking it dirty.

Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/udf/super.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 7a5f69b..dd295b8 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1770,6 +1770,7 @@ static void udf_open_lvid(struct super_block *sb)
le16_to_cpu(lvid->descTag.descCRCLength)));

lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag);
+ set_buffer_uptodate(bh);
mark_buffer_dirty(bh);
}

@@ -1805,6 +1806,7 @@ static void udf_close_lvid(struct super_block *sb)
le16_to_cpu(lvid->descTag.descCRCLength)));

lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag);
+ set_buffer_uptodate(bh);
mark_buffer_dirty(bh);
}

--
1.5.2.4