From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
adilger.kernel@dilger.ca,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Jens Axboe <axboe@kernel.dk>,
Andreas Gruenbacher <agruenba@redhat.com>,
Eric Biggers <ebiggers@google.com>,
Greg KH <gregkh@linuxfoundation.org>,
kemi.wang@intel.com,
Sabyasachi Gupta <sabyasachi.linux@gmail.com>,
Brajeswar Ghosh <brajeswar.linux@gmail.com>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: Convert int to vm_fault_t type
Date: Wed, 1 Aug 2018 10:38:30 -0400 [thread overview]
Message-ID: <20180801143830.GB10761@thunk.org> (raw)
In-Reply-To: <CAFqt6zYJv7SdkntY7KOBvNyfk-9MRaXBMmkbsc4J7P-tq616DA@mail.gmail.com>
On Wed, Aug 01, 2018 at 06:56:39PM +0530, Souptick Joarder wrote:
> As caller of block_page_mkwrite() are -
> fs/ext4/inode.c
> fs/nilfs2/file.c
>
> I will merge both changes in a single patch and send it.
Note that it's *important* for ext4 that we know what kind of error
was returned by the helper function passed into block_page_write() and
called by it. In particular, whether the error was ENOSPC or not.
That's why this change should have raised all sorts of alarums:
ext4_journal_stop(handle);
- if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
+ if (ret == VM_FAULT_SIGBUS &&
+ ext4_should_retry_alloc(inode->i_sb, &retries))
goto retry_alloc;
Note the ret == -ENOSPC --- you blindly changed it to return
VM_FAULT_SIGBUS!!!
You need to understand *why* the code does what it does, and not just
make blind mechanical replacements.
In this particular case, it probably means that if you insist on
making block_page_mkwrite() return vmfault_t, it will probably need to
take an optional "int *err" parameter, so the error can be returned to
the caller if the caller needs it.
I'm going to drop the whole ext4 changes for vm_fault_t for this
cycle, and I'll let you try to fix it up properly for the next cycle.
Regards,
- Ted
next prev parent reply other threads:[~2018-08-01 14:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-28 8:50 [PATCH] ext4: Convert int to vm_fault_t type Souptick Joarder
2018-07-28 8:49 ` Souptick Joarder
2018-08-01 12:55 ` Theodore Y. Ts'o
2018-08-01 13:04 ` Souptick Joarder
2018-08-01 13:11 ` Souptick Joarder
2018-08-01 13:13 ` Matthew Wilcox
2018-08-01 13:26 ` Souptick Joarder
2018-08-01 14:38 ` Theodore Y. Ts'o [this message]
2018-08-01 16:06 ` Theodore Y. Ts'o
2018-08-01 16:13 ` Matthew Wilcox
2018-08-01 16:22 ` Theodore Y. Ts'o
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=20180801143830.GB10761@thunk.org \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=agruenba@redhat.com \
--cc=axboe@kernel.dk \
--cc=brajeswar.linux@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=ebiggers@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jrdr.linux@gmail.com \
--cc=kemi.wang@intel.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sabyasachi.linux@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).