hfsplus: atomically read inode size
authorFabian Frederick <fabf@skynet.be>
Mon, 27 Feb 2017 22:27:19 +0000 (14:27 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Feb 2017 02:43:45 +0000 (18:43 -0800)
See i_size_read() comments in include/linux/fs.h

Link: http://lkml.kernel.org/r/20170123175338.3840-1-fabf@skynet.be
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hfsplus/wrapper.c

index ebb85e5f65499f3098fdecdc76333b40d7ad3d6b..e254fa0f069710aae74e88f41484de4d39ef7d0a 100644 (file)
@@ -132,7 +132,7 @@ static int hfsplus_get_last_session(struct super_block *sb,
 
        /* default values */
        *start = 0;
-       *size = sb->s_bdev->bd_inode->i_size >> 9;
+       *size = i_size_read(sb->s_bdev->bd_inode) >> 9;
 
        if (HFSPLUS_SB(sb)->session >= 0) {
                te.cdte_track = HFSPLUS_SB(sb)->session;