public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] fs: ubifs: Adding new return type vm_fault_t
@ 2018-04-14 20:18 Souptick Joarder
  2018-04-14 20:30 ` Richard Weinberger
  0 siblings, 1 reply; 5+ messages in thread
From: Souptick Joarder @ 2018-04-14 20:18 UTC (permalink / raw)
  To: richard, dedekind1, adrian.hunter; +Cc: linux-mtd

Use new return type vm_fault_t for page_mkwrite handler.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
---
 fs/ubifs/file.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index cf348ba..094ac73 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1513,7 +1513,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
  * mmap()d file has taken write protection fault and is being made writable.
  * UBIFS must ensure page is budgeted for.
  */
-static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
 {
 	struct page *page = vmf->page;
 	struct inode *inode = file_inode(vmf->vma->vm_file);
@@ -1567,8 +1567,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
 	if (unlikely(page->mapping != inode->i_mapping ||
 		     page_offset(page) > i_size_read(inode))) {
 		/* Page got truncated out from underneath us */
-		err = -EINVAL;
-		goto out_unlock;
+		goto sigbus;
 	}
 
 	if (PagePrivate(page))
@@ -1597,12 +1596,10 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
 	wait_for_stable_page(page);
 	return VM_FAULT_LOCKED;
 
-out_unlock:
+sigbus:
 	unlock_page(page);
 	ubifs_release_budget(c, &req);
-	if (err)
-		err = VM_FAULT_SIGBUS;
-	return err;
+	return VM_FAULT_SIGBUS;
 }
 
 static const struct vm_operations_struct ubifs_file_vm_ops = {
-- 
1.9.1

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

* Re: [PATCH] fs: ubifs: Adding new return type vm_fault_t
  2018-04-14 20:18 [PATCH] fs: ubifs: Adding new return type vm_fault_t Souptick Joarder
@ 2018-04-14 20:30 ` Richard Weinberger
  2018-04-14 20:47   ` Souptick Joarder
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2018-04-14 20:30 UTC (permalink / raw)
  To: Souptick Joarder; +Cc: dedekind1, adrian.hunter, linux-mtd

Am Samstag, 14. April 2018, 22:18:59 CEST schrieb Souptick Joarder:
> Use new return type vm_fault_t for page_mkwrite handler.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>

Can we please get a little more context?
Is this part of a patch series?
What is the target tree to carry this?

Thanks,
//richard

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

* Re: [PATCH] fs: ubifs: Adding new return type vm_fault_t
  2018-04-14 20:30 ` Richard Weinberger
@ 2018-04-14 20:47   ` Souptick Joarder
  2018-04-15  1:24     ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Souptick Joarder @ 2018-04-14 20:47 UTC (permalink / raw)
  To: Richard Weinberger, Artem Bityutskiy, adrian.hunter
  Cc: linux-mtd, Matthew Wilcox

On Sun, Apr 15, 2018 at 2:00 AM, Richard Weinberger <richard@nod.at> wrote:
> Am Samstag, 14. April 2018, 22:18:59 CEST schrieb Souptick Joarder:
>> Use new return type vm_fault_t for page_mkwrite handler.
>>
>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> Can we please get a little more context?
> Is this part of a patch series?


The plan for these patches is to introduce the typedef, initially just as
documentation ("These functions should return a VM_FAULT_ status").  We'll
trickle the patches to individual drivers/filesystems in through the
maintainers, as far as possible.  Then we'll change the typedef to an
unsigned int and break the compilation of any unconverted
drivers/filesystems.

The return value of page_mkwrite defined in vm_operations_struct has
changed to vm_fault_t type. So this patch is part of patch series which will
convert fault handlers for vm_operations_struct in each driver/file system.

The first patch is already merged into linus tree.
Commit Id -  1c8f422059ae5da07db7406ab916203f9417e396

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=1c8f422059ae5da07db7406ab916203f9417e396


What is the target tree to carry this?

Target tree I am not sure.
We have plan to push it in 4.17 release.
I think Matthew is the right person to get this info.

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

* Re: [PATCH] fs: ubifs: Adding new return type vm_fault_t
  2018-04-14 20:47   ` Souptick Joarder
@ 2018-04-15  1:24     ` Matthew Wilcox
  2018-04-15  8:05       ` Richard Weinberger
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2018-04-15  1:24 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: Richard Weinberger, Artem Bityutskiy, adrian.hunter, linux-mtd

On Sun, Apr 15, 2018 at 02:17:46AM +0530, Souptick Joarder wrote:
> On Sun, Apr 15, 2018 at 2:00 AM, Richard Weinberger <richard@nod.at> wrote:
> > What is the target tree to carry this?
> 
> Target tree I am not sure.
> We have plan to push it in 4.17 release.
> I think Matthew is the right person to get this info.

Please merge it through your tree for 4.18.  Or earlier if you want.

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

* Re: [PATCH] fs: ubifs: Adding new return type vm_fault_t
  2018-04-15  1:24     ` Matthew Wilcox
@ 2018-04-15  8:05       ` Richard Weinberger
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Weinberger @ 2018-04-15  8:05 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Souptick Joarder, Artem Bityutskiy, adrian.hunter, linux-mtd

Am Sonntag, 15. April 2018, 03:24:00 CEST schrieb Matthew Wilcox:
> On Sun, Apr 15, 2018 at 02:17:46AM +0530, Souptick Joarder wrote:
> > On Sun, Apr 15, 2018 at 2:00 AM, Richard Weinberger <richard@nod.at> wrote:
> > > What is the target tree to carry this?
> > 
> > Target tree I am not sure.
> > We have plan to push it in 4.17 release.
> > I think Matthew is the right person to get this info.
> 
> Please merge it through your tree for 4.18.  Or earlier if you want.

Ok. Queued for 4.18.

Thanks,
//richard

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

end of thread, other threads:[~2018-04-15  8:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-14 20:18 [PATCH] fs: ubifs: Adding new return type vm_fault_t Souptick Joarder
2018-04-14 20:30 ` Richard Weinberger
2018-04-14 20:47   ` Souptick Joarder
2018-04-15  1:24     ` Matthew Wilcox
2018-04-15  8:05       ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox