From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs: fix off-by-one in lseek
Date: Mon, 7 Jan 2013 11:53:08 +0800 [thread overview]
Message-ID: <1357530788-5790-1-git-send-email-bo.li.liu@oracle.com> (raw)
Lock end is inclusive.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
fs/btrfs/file.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 77061bf..1e16b6d 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2241,6 +2241,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int whence)
if (lockend <= lockstart)
lockend = lockstart + root->sectorsize;
+ lockend--;
len = lockend - lockstart + 1;
len = max_t(u64, len, root->sectorsize);
--
1.7.7.6
next reply other threads:[~2013-01-07 3:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 3:53 Liu Bo [this message]
2013-01-07 16:20 ` [PATCH] Btrfs: fix off-by-one in lseek David Sterba
2013-01-08 2:46 ` Liu Bo
2013-01-08 8:30 ` David Sterba
2013-01-08 17:26 ` David Sterba
2013-01-09 4:34 ` Liu Bo
2013-01-09 11:50 ` David Sterba
2013-01-09 12:49 ` David Sterba
2013-01-10 2:17 ` Liu Bo
2013-01-10 11:04 ` David Sterba
2013-01-10 13:34 ` Liu Bo
2013-01-11 15:25 ` David Sterba
2013-01-11 17:49 ` David Sterba
2013-04-30 14:28 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357530788-5790-1-git-send-email-bo.li.liu@oracle.com \
--to=bo.li.liu@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).