[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1427247076-9873-1-git-send-email-csong84@gatech.edu>
Date: Tue, 24 Mar 2015 21:31:16 -0400
From: Chengyu Song <csong84@...ech.edu>
To: dushistov@...l.ru, linux-kernel@...r.kernel.org
Cc: taesoo@...ech.edu, changwoo@...ech.edu, sanidhya@...ech.edu,
blee@...ech.edu, csong84@...ech.edu
Subject: [PATCH 1/1] ufs: missing check for block_truncate_page
block_truncate_page may fail under certain circumstances, so its result
should be checked.
Signed-off-by: Chengyu Song <csong84@...ech.edu>
---
fs/ufs/truncate.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index f04f89f..8b41f07 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -464,7 +464,12 @@ int ufs_truncate(struct inode *inode, loff_t old_i_size)
goto out;
}
- block_truncate_page(inode->i_mapping, inode->i_size, ufs_getfrag_block);
+ err = block_truncate_page(inode->i_mapping, inode->i_size, ufs_getfrag_block);
+
+ if (err) {
+ i_size_write(inode, old_i_size);
+ goto out;
+ }
while (1) {
retry = ufs_trunc_direct(inode);
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists