The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: dsterba@suse.cz, Matthew Wilcox <willy@infradead.org>,
	Chris Mason <clm@fb.com>,
	jbacik@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: btrfs: Change return type to vm_fault_t
Date: Wed, 6 Jun 2018 16:45:35 +0200	[thread overview]
Message-ID: <20180606144535.GH3539@twin.jikos.cz> (raw)
In-Reply-To: <CAFqt6zY-q4xV+PAFKXfa+NjNYyiBy4K5VSykKqbeN0XGpCTudw@mail.gmail.com>

On Wed, Jun 06, 2018 at 07:39:53PM +0530, Souptick Joarder wrote:
> >> @@ -8885,8 +8885,9 @@ int btrfs_page_mkwrite(struct vm_fault *vmf)
> >>       char *kaddr;
> >>       unsigned long zero_start;
> >>       loff_t size;
> >> -     int ret;
> >> +     int err;
> >
> > Please use ret2 for the variable name. We're leaving the err/ret naming
> > pattern and use 'ret' to match the function return value and ret2, ret3
> > for the temporary return values.
> 
> Is this new pattern specific to fs/btrfs file system ?

Yes it is, you're not expected to know it in advance but as this was not
the only thing to update in the patch I did not fix it myself.

> >> -     ret = 0;
> >> +     err = 0;
> >>
> >>       /* page is wholly or partially inside EOF */
> >>       if (page_start + PAGE_SIZE > size)
> >> @@ -9009,11 +9007,11 @@ int btrfs_page_mkwrite(struct vm_fault *vmf)
> >>       unlock_extent_cached(io_tree, page_start, page_end, &cached_state);
> >>
> >>  out_unlock:
> >> -     if (!ret) {
> >> +     if (!err) {
> >>               btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true);
> >>               sb_end_pagefault(inode->i_sb);
> >>               extent_changeset_free(data_reserved);
> >> -             return VM_FAULT_LOCKED;
> >> +             ret = VM_FAULT_LOCKED;
> >
> > That's not a direct change as it changes the code flow and lets the
> > branch continue. As the error handling and cleanup code is partially
> > done in this branch continuing wrong AFAICS.
> 
> Sorry about it, I will correct and send v2.
> Is it possible to get it merge in 4.18 / 4.18-rc-X ?

Ok.

      reply	other threads:[~2018-06-06 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05 15:46 [PATCH] fs: btrfs: Change return type to vm_fault_t Souptick Joarder
2018-06-06 13:22 ` David Sterba
2018-06-06 14:09   ` Souptick Joarder
2018-06-06 14:45     ` David Sterba [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180606144535.GH3539@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox