* [PATCH] raid1: use an int as the return value of raise_barrier()
@ 2019-07-02 14:35 Hou Tao
2019-07-22 21:46 ` Song Liu
0 siblings, 1 reply; 2+ messages in thread
From: Hou Tao @ 2019-07-02 14:35 UTC (permalink / raw)
To: linux-raid, songliubraving; +Cc: linux-kernel
Using a sector_t as the return value is misleading, because
raise_barrier() only return 0 or -EINTR.
Also add comments for the return values of raise_barrier().
Signed-off-by: Hou Tao <houtao1@huawei.com>
---
drivers/md/raid1.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index da06bb47195b..c1ea5e0c3cf6 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -846,8 +846,10 @@ static void flush_pending_writes(struct r1conf *conf)
* backgroup IO calls must call raise_barrier. Once that returns
* there is no normal IO happeing. It must arrange to call
* lower_barrier when the particular background IO completes.
+ *
+ * Will return -EINTR if resync/recovery is interrupted, else return 0.
*/
-static sector_t raise_barrier(struct r1conf *conf, sector_t sector_nr)
+static int raise_barrier(struct r1conf *conf, sector_t sector_nr)
{
int idx = sector_to_idx(sector_nr);
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] raid1: use an int as the return value of raise_barrier()
2019-07-02 14:35 [PATCH] raid1: use an int as the return value of raise_barrier() Hou Tao
@ 2019-07-22 21:46 ` Song Liu
0 siblings, 0 replies; 2+ messages in thread
From: Song Liu @ 2019-07-22 21:46 UTC (permalink / raw)
To: Hou Tao; +Cc: linux-raid, Song Liu, open list
On Tue, Jul 2, 2019 at 7:30 AM Hou Tao <houtao1@huawei.com> wrote:
>
> Using a sector_t as the return value is misleading, because
> raise_barrier() only return 0 or -EINTR.
>
> Also add comments for the return values of raise_barrier().
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
Applied. Thanks for the patch.
Song
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-22 21:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 14:35 [PATCH] raid1: use an int as the return value of raise_barrier() Hou Tao
2019-07-22 21:46 ` Song Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).