ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] netfs, afs: Fix write_begin/end
@ 2021-06-21 20:41 David Howells
  2021-06-24 10:32 ` Jeff Layton
  2021-06-25 17:48 ` pr-tracker-bot
  0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2021-06-21 20:41 UTC (permalink / raw)
  To: torvalds
  Cc: dhowells, Andrew W Elble, Jeff Layton, Matthew Wilcox (Oracle),
	Al Viro, ceph-devel, linux-afs, linux-cachefs, linux-fsdevel,
	linux-kernel

Hi Linus,

Could you pull this please?  It includes patches to fix netfs_write_begin()
and afs_write_end() in the following ways:

 (1) In netfs_write_begin(), extract the decision about whether to skip a
     page out to its own helper and have that clear around the region to be
     written, but not clear that region.  This requires the filesystem to
     patch it up afterwards if the hole doesn't get completely filled.

 (2) Use offset_in_thp() in (1) rather than manually calculating the offset
     into the page.

 (3) Due to (1), afs_write_end() now needs to handle short data write into
     the page by generic_perform_write().  I've adopted an analogous
     approach to ceph of just returning 0 in this case and letting the
     caller go round again.

It also adds a note that (in the future) the len parameter may extend
beyond the page allocated.  This is because the page allocation is deferred
to write_begin() and that gets to decide what size of THP to allocate.

Thanks,
David

Link: https://lore.kernel.org/r/20210613233345.113565-1-jlayton@kernel.org/
Link: https://lore.kernel.org/r/162367681795.460125.11729955608839747375.stgit@warthog.procyon.org.uk/ # v1
Link: https://lore.kernel.org/r/162391823192.1173366.9740514875196345746.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/162429000639.2770648.6368710175435880749.stgit@warthog.procyon.org.uk/ # v3

Changes
=======

ver #3:
   - Drop the bits that make afs take account of len exceeding the end of
     the page in afs_write_begin/end().

ver #2:
   - Removed a var that's no longer used (spotted by the kernel test robot)
   - Removed a forgotten "noinline".

ver #1:
   - Prefixed the Jeff's new helper with "netfs_".
   - Don't call zero_user_segments() for a full-page write.
   - Altered the beyond-last-page check to avoid a DIV.
   - Removed redundant zero-length-file check.
   - Added patches to fix afs.

---
The following changes since commit 009c9aa5be652675a06d5211e1640e02bbb1c33d:

  Linux 5.13-rc6 (2021-06-13 14:43:10 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/netfs-fixes-20210621

for you to fetch changes up to 827a746f405d25f79560c7868474aec5aee174e1:

  netfs: fix test for whether we can skip read when writing beyond EOF (2021-06-21 21:24:07 +0100)

----------------------------------------------------------------
netfslib fixes

----------------------------------------------------------------
David Howells (1):
      afs: Fix afs_write_end() to handle short writes

Jeff Layton (1):
      netfs: fix test for whether we can skip read when writing beyond EOF

 fs/afs/write.c         | 11 +++++++++--
 fs/netfs/read_helper.c | 49 ++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 45 insertions(+), 15 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [GIT PULL] netfs, afs: Fix write_begin/end
  2021-06-21 20:41 [GIT PULL] netfs, afs: Fix write_begin/end David Howells
@ 2021-06-24 10:32 ` Jeff Layton
  2021-06-25 17:48 ` pr-tracker-bot
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2021-06-24 10:32 UTC (permalink / raw)
  To: David Howells, torvalds
  Cc: Andrew W Elble, Matthew Wilcox (Oracle),
	Al Viro, ceph-devel, linux-afs, linux-cachefs, linux-fsdevel,
	linux-kernel

On Mon, 2021-06-21 at 21:41 +0100, David Howells wrote:
> Hi Linus,
> 
> Could you pull this please?  It includes patches to fix netfs_write_begin()
> and afs_write_end() in the following ways:
> 
>  (1) In netfs_write_begin(), extract the decision about whether to skip a
>      page out to its own helper and have that clear around the region to be
>      written, but not clear that region.  This requires the filesystem to
>      patch it up afterwards if the hole doesn't get completely filled.
> 
>  (2) Use offset_in_thp() in (1) rather than manually calculating the offset
>      into the page.
> 
>  (3) Due to (1), afs_write_end() now needs to handle short data write into
>      the page by generic_perform_write().  I've adopted an analogous
>      approach to ceph of just returning 0 in this case and letting the
>      caller go round again.
> 
> It also adds a note that (in the future) the len parameter may extend
> beyond the page allocated.  This is because the page allocation is deferred
> to write_begin() and that gets to decide what size of THP to allocate.
> 
> Thanks,
> David
> 
> Link: https://lore.kernel.org/r/20210613233345.113565-1-jlayton@kernel.org/
> Link: https://lore.kernel.org/r/162367681795.460125.11729955608839747375.stgit@warthog.procyon.org.uk/ # v1
> Link: https://lore.kernel.org/r/162391823192.1173366.9740514875196345746.stgit@warthog.procyon.org.uk/ # v2
> Link: https://lore.kernel.org/r/162429000639.2770648.6368710175435880749.stgit@warthog.procyon.org.uk/ # v3
> 
> Changes
> =======
> 
> ver #3:
>    - Drop the bits that make afs take account of len exceeding the end of
>      the page in afs_write_begin/end().
> 
> ver #2:
>    - Removed a var that's no longer used (spotted by the kernel test robot)
>    - Removed a forgotten "noinline".
> 
> ver #1:
>    - Prefixed the Jeff's new helper with "netfs_".
>    - Don't call zero_user_segments() for a full-page write.
>    - Altered the beyond-last-page check to avoid a DIV.
>    - Removed redundant zero-length-file check.
>    - Added patches to fix afs.
> 
> ---
> The following changes since commit 009c9aa5be652675a06d5211e1640e02bbb1c33d:
> 
>   Linux 5.13-rc6 (2021-06-13 14:43:10 -0700)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/netfs-fixes-20210621
> 
> for you to fetch changes up to 827a746f405d25f79560c7868474aec5aee174e1:
> 
>   netfs: fix test for whether we can skip read when writing beyond EOF (2021-06-21 21:24:07 +0100)
> 
> ----------------------------------------------------------------
> netfslib fixes
> 
> ----------------------------------------------------------------
> David Howells (1):
>       afs: Fix afs_write_end() to handle short writes
> 
> Jeff Layton (1):
>       netfs: fix test for whether we can skip read when writing beyond EOF
> 
>  fs/afs/write.c         | 11 +++++++++--
>  fs/netfs/read_helper.c | 49 ++++++++++++++++++++++++++++++++++++-------------
>  2 files changed, 45 insertions(+), 15 deletions(-)
> 

Hi Linus,

Is there some reason you haven't pulled these fixes? The netfs fix in
particular fixes a data corruption bug in cephfs, so we're quite keen to
get that in before v5.13 ships.

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [GIT PULL] netfs, afs: Fix write_begin/end
  2021-06-21 20:41 [GIT PULL] netfs, afs: Fix write_begin/end David Howells
  2021-06-24 10:32 ` Jeff Layton
@ 2021-06-25 17:48 ` pr-tracker-bot
  1 sibling, 0 replies; 3+ messages in thread
From: pr-tracker-bot @ 2021-06-25 17:48 UTC (permalink / raw)
  To: David Howells
  Cc: torvalds, dhowells, Andrew W Elble, Jeff Layton,
	Matthew Wilcox (Oracle),
	Al Viro, ceph-devel, linux-afs, linux-cachefs, linux-fsdevel,
	linux-kernel

The pull request you sent on Mon, 21 Jun 2021 21:41:02 +0100:

> git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/netfs-fixes-20210621

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/9e736cf7d6f0dac63855ba74c94b85898485ba7a

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-25 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 20:41 [GIT PULL] netfs, afs: Fix write_begin/end David Howells
2021-06-24 10:32 ` Jeff Layton
2021-06-25 17:48 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).