[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180801143830.GB10761@thunk.org>
Date: Wed, 1 Aug 2018 10:38:30 -0400
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Souptick Joarder <jrdr.linux@...il.com>
Cc: Matthew Wilcox <willy@...radead.org>, adilger.kernel@...ger.ca,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Jens Axboe <axboe@...nel.dk>,
Andreas Gruenbacher <agruenba@...hat.com>,
Eric Biggers <ebiggers@...gle.com>,
Greg KH <gregkh@...uxfoundation.org>, kemi.wang@...el.com,
Sabyasachi Gupta <sabyasachi.linux@...il.com>,
Brajeswar Ghosh <brajeswar.linux@...il.com>,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: Convert int to vm_fault_t type
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
Powered by blists - more mailing lists