diff options
author | Anton Altaparmakov <anton@tuxera.com> | 2017-07-17 01:54:54 +0100 |
---|---|---|
committer | Anton Altaparmakov <anton@tuxera.com> | 2017-07-17 01:54:54 +0100 |
commit | 23f5cbcc20d6faf57edd9a92de10da73ef24e43f (patch) | |
tree | 5d3d0d82b9ce665ea050253a534f28068f9121c1 | |
parent | 87b2c3fc63175bb32c96d4ec58152d4fdd5a4ae1 (diff) | |
download | ntfs-23f5cbcc20d6faf57edd9a92de10da73ef24e43f.tar.gz |
Fix off by one error in if statement in ntfs_mft_record_format().
Signed-off-by: Anton Altaparmakov <anton@tuxera.com>
-rw-r--r-- | fs/ntfs/mft.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index b6f402194f02c..909f71a238cbf 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -1,7 +1,7 @@ /** * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project. * - * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. + * Copyright (c) 2001-2017 Anton Altaparmakov and Tuxera Inc. * Copyright (c) 2002 Richard Russon * * This program/include file is free software; you can redistribute it and/or @@ -2110,7 +2110,7 @@ static int ntfs_mft_record_format(const ntfs_volume *vol, const s64 mft_no) i_size = i_size_read(mft_vi); end_index = i_size >> PAGE_SHIFT; if (unlikely(index >= end_index)) { - if (unlikely(index > end_index || ofs + vol->mft_record_size >= + if (unlikely(index > end_index || ofs + vol->mft_record_size > (i_size & ~PAGE_MASK))) { ntfs_error(vol->sb, "Tried to format non-existing mft " "record 0x%llx.", (long long)mft_no); |