lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <8ea91e81-9b96-458e-bd4e-64eada31e184@oracle.com> Date: Mon, 5 May 2025 11:04:55 +0100 From: John Garry <john.g.garry@...cle.com> To: Christoph Hellwig <hch@....de> Cc: brauner@...nel.org, djwong@...nel.org, viro@...iv.linux.org.uk, jack@...e.cz, cem@...nel.org, linux-fsdevel@...r.kernel.org, dchinner@...hat.com, linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org, ojaswin@...ux.ibm.com, ritesh.list@...il.com, martin.petersen@...cle.com, linux-ext4@...r.kernel.org, linux-block@...r.kernel.org, catherine.hoang@...cle.com, linux-api@...r.kernel.org Subject: Re: [PATCH v11 02/16] xfs: only call xfs_setsize_buftarg once per buffer target On 05/05/2025 06:40, Christoph Hellwig wrote: >> +/* >> + * Flush and invalidate all devices' pagecaches before reading any metadata >> + * because XFS doesn't use the bdev pagecache. >> + */ >> +STATIC int >> +xfs_preflush_devices( >> + struct xfs_mount *mp) >> +{ >> + int error; >> + >> + error = xfs_buftarg_sync(mp->m_ddev_targp); >> + if (error) >> + return error; >> + >> + if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { >> + error = xfs_buftarg_sync(mp->m_ddev_targp); >> + if (error) >> + return error; >> + } > Why does this duplicate all the logic instead of being folded into > xfs_open_devices? So you mean an additive change like: diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 64fbd089ef55..9fa538938e07 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -488,6 +488,9 @@ xfs_open_devices( mp->m_ddev_targp = xfs_alloc_buftarg(mp, sb->s_bdev_file); if (!mp->m_ddev_targp) goto out_close_rtdev; + error = sync_blockdev(mp->m_ddev_targp->bt_bdev); + if (error) + goto out_close_rtdev; if (rtdev_file) { @@ -495,6 +498,9 @@ xfs_open_devices( mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev_file); if (!mp->m_rtdev_targp) goto out_free_ddev_targ; + error = sync_blockdev(mp->m_rtdev_targp->bt_bdev); + if (error) + goto out_free_ddev_targ; } if (logdev_file && file_bdev(logdev_file) != ddev) { @@ -503,6 +509,9 @@ xfs_open_devices( mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev_file); if (!mp->m_logdev_targp) goto out_free_rtdev_targ; + error = sync_blockdev(mp->m_logdev_targp->bt_bdev); + if (error) + goto out_free_rtdev_targ; } else { mp->m_logdev_targp = mp->m_ddev_targp; /* Handle won't be used, drop it */ Right?
Powered by blists - more mailing lists