Re: NFS data corruption on congested network

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 26 Feb 2024 at 00:19, NeilBrown <neilb@xxxxxxx> wrote:
>
> On Mon, 26 Feb 2024, NeilBrown wrote:
> > On Fri, 23 Feb 2024, Jacek Tomaka wrote:
> > > Hello,
> > > I ran into an issue where the NFS file ends up being corrupted on disk. We started noticing it on certain, quite old hardware after upgrading OS from Centos 6 to Rocky 9.2. We do see it on Rocky 9.3 but not on 9.1.
> > >
> > > After some investigation we have reasons to believe that the change was introduced by the following commit:
> > > https://github.com/torvalds/linux/commit/6df25e58532be7a4cd6fb15bcd85805947402d91
> >
> > Thanks for the report.
> > Can you try a change to your kernel?
> >
> > diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> > index bb79d3a886ae..08a787147bd2 100644
> > --- a/fs/nfs/write.c
> > +++ b/fs/nfs/write.c
> > @@ -668,8 +668,10 @@ static int nfs_writepage_locked(struct folio *folio,
> >       int err;
> >
> >       if (wbc->sync_mode == WB_SYNC_NONE &&
> > -         NFS_SERVER(inode)->write_congested)
> > +         NFS_SERVER(inode)->write_congested) {
> > +             folio_redirty_for_writepage(wbc, folio);
> >               return AOP_WRITEPAGE_ACTIVATE;
> > +     }
> >
> >       nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
> >       nfs_pageio_init_write(&pgio, inode, 0, false,
>
> Actually this is only needed before linux 6.8 as only nfs_writepage()
> can call nfs_writepage_locked() with sync_mode of WB_SYNC_NONE.
> So v5.18 through v6.7 might need fixing.

Please do not forget the Linux 6.6-stable branch!!

Ced
-- 
Cedric Blancher <cedric.blancher@xxxxxxxxx>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux