[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DDB9C85B850785449757F9914A034FCB444D1C18@G9W0766.americas.hpqcorp.net>
Date: Thu, 12 Nov 2015 00:56:02 +0000
From: "Seymour, Shane M" <shane.seymour@....com>
To: "Darrick J. Wong" <darrick.wong@...cle.com>
CC: Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@...radead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
Jeff Layton <jlayton@...chiereds.net>,
"J. Bruce Fields" <bfields@...ldses.org>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>
Subject: RE: [PATCH] block: create ioctl to discard-or-zeroout a range of
blocks
> which would make the other checks I suggested to ensure that neither start
> or end were more than (uint64_t)LLONG_MAX unnecessary.
My apologies I was wrong about what I said above - after thinking about it for longer you still need to make sure that at least len is not greater than (uint64_t)LLONG_MAX because in the calculation:
if (start > (uint64_t)LLONG_MAX - len)
return -EINVAL;
if len was more than (uint64_t)LLONG_MAX it would underflow and become a very large positive number and start would never be greater than that (and I said end when I should have said len).
--
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