diff options
| author | Mike Marshall <hubcap@omnibond.com> | 2025-06-04 11:23:02 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-10 07:15:56 -0400 |
| commit | a5336ada21b113a17cd95176741aaed3aa690d82 (patch) | |
| tree | b22c2685afc10e17eb0fa21286824dbbf6985f1d | |
| parent | 57082e0300d56e7aad1a874788aedd556028c90a (diff) | |
| download | linux-stable-a5336ada21b113a17cd95176741aaed3aa690d82.tar.gz linux-stable-a5336ada21b113a17cd95176741aaed3aa690d82.zip | |
orangefs: adjust counting code to recover from 665575cf
A late commit to 6.14-rc7 (665575cf) broke orangefs. This is a several line
adjustment to some counters needed to keep orangefs from deadlocking
when writing page cache data out to the filesystem.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | fs/orangefs/inode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 63d7c1ca0dfd..a244f397a68c 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -32,12 +32,13 @@ static int orangefs_writepage_locked(struct page *page, len = i_size_read(inode); if (PagePrivate(page)) { wr = (struct orangefs_write_range *)page_private(page); - WARN_ON(wr->pos >= len); off = wr->pos; - if (off + wr->len > len) + if ((off + wr->len > len) && (off <= len)) wlen = len - off; else wlen = wr->len; + if (wlen == 0) + wlen = wr->len; } else { WARN_ON(1); off = page_offset(page); @@ -46,8 +47,6 @@ static int orangefs_writepage_locked(struct page *page, else wlen = PAGE_SIZE; } - /* Should've been handled in orangefs_invalidate_folio. */ - WARN_ON(off == len || off + wlen > len); WARN_ON(wlen == 0); bvec_set_page(&bv, page, wlen, off % PAGE_SIZE); @@ -340,6 +339,8 @@ static int orangefs_write_begin(struct file *file, wr->len += len; goto okay; } else { + wr->pos = pos; + wr->len = len; ret = orangefs_launder_folio(folio); if (ret) return ret; |
