public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>, Al Viro <viro@zeniv.linux.org.uk>
Cc: Evgeniy Dushistov <dushistov@mail.ru>,
	Ira Weiny <ira.weiny@intel.com>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	Evgeniy Dushistov <dushistov@mail.ru>,
	Ira Weiny <ira.weiny@intel.com>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/3] fs/ufs: Change the signature of ufs_get_page()
Date: Mon, 12 Dec 2022 21:08:49 +0100	[thread overview]
Message-ID: <8194794.NyiUUSuA9g@suse> (raw)
In-Reply-To: <Y5Zc0qZ3+zsI74OZ@ZenIV>

On domenica 11 dicembre 2022 23:42:26 CET Al Viro wrote:
> On Sun, Dec 11, 2022 at 10:31:10PM +0100, Fabio M. De Francesco wrote:
> >  out_put:
> >  	ufs_put_page(page);
> > 
> > -out:
> > -	return err;
> > 
> >  out_unlock:
> >  	unlock_page(page);
> >  	goto out_put;
> 
> Something strange has happened, all right - look at the situation
> after that patch.  You've got
> 
> out_put:
> 	ufs_put_page(page);
> out_unlock:
> 	unlock_page(page);
> 	goto out_put;
> 
> Which is obviously bogus.

I finally could go back to this small series and while working to fix the 
errors that yesterday you had found out I think I saw what happened...

Are you talking about ufs_add_link, right?

If so, you wrote what follows at point 14 of one of your emails:

-----

14) ufs_add_link() - similar adjustment to new calling conventions
for ufs_get_page().  Uses of page_addr: fed to ufs_put_page() (same as
in ufs_find_entry() kaddr is guaranteed to point into the same page and
thus can be used instead) and calculation of position in directory, same
as we'd seen in ufs_set_link().  The latter becomes page_offset(page) +
offset_in_page(de), killing page_addr off.  BTW, we get
                kaddr = ufs_get_page(dir, n, &page);
                err = PTR_ERR(kaddr);
                if (IS_ERR(kaddr))
                        goto out;
with out: being just 'return err;', which suggests
                kaddr = ufs_get_page(dir, n, &page);
                if (IS_ERR(kaddr))
                        return ERR_PTR(kaddr);
instead (and that was the only goto out; so the label can be removed).
The value stored in err in case !IS_ERR(kaddr) is (thankfully) never
used - would've been a bug otherwise.  So this is an equivalent 
transformation.

-----

Did you notice "so the label can be removed"?
I must have misinterpreted what you wrote there. Did I?

I removed the "out" label, according to what it seemed to me the correct way 
to interpret your words.

However at that moment I didn't see the endless loop at the end of the 
function. Then I "fixed" (sigh!) it in 3/3 by terminating that endless loop
with a "return 0". 

However that was another mistake because after "got_it:" label we have "err = 
ufs_commit_chunk(page, pos, rec_len);". 

To summarize: I can delete _only_ the label and leave the "return err;" in the 
block after the "out_put:" label. 

Am I looking at it correctly now?

Thanks,

Fabio



  reply	other threads:[~2022-12-12 20:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11 21:31 [PATCH 0/3] fs/ufs: replace kmap() with kmap_local_page() Fabio M. De Francesco
2022-12-11 21:31 ` [PATCH 1/3] fs/ufs: Use the offset_in_page() helper Fabio M. De Francesco
2022-12-11 21:31 ` [PATCH 2/3] fs/ufs: Change the signature of ufs_get_page() Fabio M. De Francesco
2022-12-11 22:29   ` Al Viro
2022-12-11 23:56     ` Fabio M. De Francesco
2022-12-11 22:42   ` Al Viro
2022-12-12 20:08     ` Fabio M. De Francesco [this message]
2022-12-11 21:31 ` [PATCH 3/3] fs/ufs: Replace kmap() with kmap_local_page() Fabio M. De Francesco
2022-12-11 22:39   ` Al Viro
2022-12-12  0:14     ` Fabio M. De Francesco
2022-12-12  0:52   ` kernel test robot
2022-12-12  1:07     ` Al Viro

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=8194794.NyiUUSuA9g@suse \
    --to=fmdefrancesco@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=dushistov@mail.ru \
    --cc=ira.weiny@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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