Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont()

KERN_CONT hails from a simpler time, when SMP wasn't the norm. These
days, it doesn't quite work right since another printk() can always race
in between the first one and the one being "continued".

Nothing calls dprintk_rcu_cont(), so just remove it. The only caller of
dprintk_cont() is in nfs_commit_release_pages(). Just use a normal
dprintk() there instead, since this is not SMP-safe anyway.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

authored by

Jeff Layton and committed by
Anna Schumaker
9082aae1 64dd8022

+5 -25
+3 -3
fs/nfs/write.c
··· 1818 1818 nfs_mapping_set_error(folio, status); 1819 1819 nfs_inode_remove_request(req); 1820 1820 } 1821 - dprintk_cont(", error = %d\n", status); 1821 + dprintk(", error = %d\n", status); 1822 1822 goto next; 1823 1823 } 1824 1824 ··· 1828 1828 /* We have a match */ 1829 1829 if (folio) 1830 1830 nfs_inode_remove_request(req); 1831 - dprintk_cont(" OK\n"); 1831 + dprintk(" OK\n"); 1832 1832 goto next; 1833 1833 } 1834 1834 /* We have a mismatch. Write the page again */ 1835 - dprintk_cont(" mismatch\n"); 1835 + dprintk(" mismatch\n"); 1836 1836 nfs_mark_request_dirty(req); 1837 1837 atomic_long_inc(&NFS_I(data->inode)->redirtied_pages); 1838 1838 next:
+2 -22
include/linux/sunrpc/debug.h
··· 23 23 24 24 #define dprintk(fmt, ...) \ 25 25 dfprintk(FACILITY, fmt, ##__VA_ARGS__) 26 - #define dprintk_cont(fmt, ...) \ 27 - dfprintk_cont(FACILITY, fmt, ##__VA_ARGS__) 28 26 #define dprintk_rcu(fmt, ...) \ 29 27 dfprintk_rcu(FACILITY, fmt, ##__VA_ARGS__) 30 - #define dprintk_rcu_cont(fmt, ...) \ 31 - dfprintk_rcu_cont(FACILITY, fmt, ##__VA_ARGS__) 32 28 33 29 #undef ifdebug 34 30 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) ··· 33 37 # define dfprintk(fac, fmt, ...) \ 34 38 do { \ 35 39 ifdebug(fac) \ 36 - printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \ 37 - } while (0) 38 - 39 - # define dfprintk_cont(fac, fmt, ...) \ 40 - do { \ 41 - ifdebug(fac) \ 42 - printk(KERN_CONT fmt, ##__VA_ARGS__); \ 40 + printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \ 43 41 } while (0) 44 42 45 43 # define dfprintk_rcu(fac, fmt, ...) \ 46 44 do { \ 47 45 ifdebug(fac) { \ 48 46 rcu_read_lock(); \ 49 - printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \ 50 - rcu_read_unlock(); \ 51 - } \ 52 - } while (0) 53 - 54 - # define dfprintk_rcu_cont(fac, fmt, ...) \ 55 - do { \ 56 - ifdebug(fac) { \ 57 - rcu_read_lock(); \ 58 - printk(KERN_CONT fmt, ##__VA_ARGS__); \ 47 + printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \ 59 48 rcu_read_unlock(); \ 60 49 } \ 61 50 } while (0) ··· 49 68 #else 50 69 # define ifdebug(fac) if (0) 51 70 # define dfprintk(fac, fmt, ...) do {} while (0) 52 - # define dfprintk_cont(fac, fmt, ...) do {} while (0) 53 71 # define dfprintk_rcu(fac, fmt, ...) do {} while (0) 54 72 # define RPC_IFDEBUG(x) 55 73 #endif