Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Device-mapper Development (http://www.linux-archive.org/device-mapper-development/)
-   -   block: all callers should check blkdev_issue_flush's return (http://www.linux-archive.org/device-mapper-development/677360-block-all-callers-should-check-blkdev_issue_flushs-return.html)

Mike Snitzer 06-26-2012 03:27 PM

block: all callers should check blkdev_issue_flush's return
 
It is concerning that a FLUSH may fail but the blkdev_issue_flush
callers assume it will always succeed.

Each blkdev_issue_flush caller should come to terms with the reality
that a FLUSH may fail -- the file_operations' .fsync methods in
particular. nilfs2 is the only filesystem that checks
blkdev_issue_flush's return.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
include/linux/blkdev.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ba43f40..76d6e48 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -968,7 +968,7 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,

#define BLKDEV_DISCARD_SECURE 0x01 /* secure discard */

-extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
+extern int __must_check blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
--
1.7.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Jeff Moyer 06-26-2012 03:33 PM

block: all callers should check blkdev_issue_flush's return
 
Mike Snitzer <snitzer@redhat.com> writes:

> It is concerning that a FLUSH may fail but the blkdev_issue_flush
> callers assume it will always succeed.
>
> Each blkdev_issue_flush caller should come to terms with the reality
> that a FLUSH may fail -- the file_operations' .fsync methods in
> particular. nilfs2 is the only filesystem that checks
> blkdev_issue_flush's return.

Yeah, as it stands, it looks like in many cases fsync won't return an
error if a flush fails. That's bad.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


All times are GMT. The time now is 04:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.