Whamcloud - gitweb
LU-15181 osd-ldiskfs: a typo in osd_declare_write_commit() 23/45423/3
authorAndrew Perepechko <andrew.perepechko@hpe.com>
Sun, 31 Oct 2021 19:03:48 +0000 (22:03 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Nov 2021 03:53:06 +0000 (03:53 +0000)
A typo in osd_declare_write_commit() makes ASAN emit warnings like:
UBSAN: Undefined behaviour in /lustre/osd-ldiskfs/osd_io.c:1404:2
shift exponent 4096 is too large for 32-bit type 'int'

Change-Id: Ie612d9c6655211445c00bd17fa1bf7a836af3542
Fixes: f0f92773e ("LU-14187 osd-ldiskfs: fix locking in write commit")
Signed-off-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-on: https://review.whamcloud.com/45423
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
lustre/osd-ldiskfs/osd_io.c

index a41799b..5a3bd8c 100644 (file)
@@ -1413,7 +1413,7 @@ static int osd_declare_write_commit(const struct lu_env *env,
         * heavily-fragmented, it will be reduced to 4K at the worst.
         */
        extent_bytes = osd_extent_bytes(osd);
-       LASSERT(extent_bytes >= (1 << osd_sb(osd)->s_blocksize));
+       LASSERT(extent_bytes >= osd_sb(osd)->s_blocksize);
 
        /* calculate number of extents (probably better to pass nb) */
        for (i = 0; i < npages; i++) {