2014-02-28 07:29:14

by Zhang Zhen

[permalink] [raw]
Subject: [PATCH] ext3: fix some wrong comments

The comments in the code are wrong, because every generic_file_write()
is replaced by generic_file_aio_write().

Signed-off-by: Zhang Zhen <[email protected]>
---
fs/ext3/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 384b6eb..0b94832 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1574,7 +1574,7 @@ static int buffer_unmapped(handle_t *handle, struct buffer_head *bh)
*
* Similar for:
*
- * ext3_file_write() -> generic_file_write() -> __alloc_pages() -> ...
+ * ext3_file_write() -> generic_file_aio_write() -> __alloc_pages() -> ...
*
* Same applies to ext3_get_block(). We will deadlock on various things like
* lock_journal and i_truncate_mutex.
@@ -3212,7 +3212,7 @@ out_brelse:
*
* We are called from a few places:
*
- * - Within generic_file_write() for O_SYNC files.
+ * - Within generic_file_aio_write() for O_SYNC files.
* Here, there will be no transaction running. We wait for any running
* transaction to commit.
*
--
1.8.1.4


.




_______________________________________________
kernel.openeuler mailing list
[email protected]
http://rnd-openeuler.huawei.com/mailman/listinfo/kernel.openeuler







2014-02-28 08:37:12

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH] ext3: fix some wrong comments

On Fri 28-02-14 15:28:59, ZhangZhen wrote:
> The comments in the code are wrong, because every generic_file_write()
> is replaced by generic_file_aio_write().
>
> Signed-off-by: Zhang Zhen <[email protected]>
> ---
> fs/ext3/inode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index 384b6eb..0b94832 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -1574,7 +1574,7 @@ static int buffer_unmapped(handle_t *handle, struct buffer_head *bh)
> *
> * Similar for:
> *
> - * ext3_file_write() -> generic_file_write() -> __alloc_pages() -> ...
> + * ext3_file_write() -> generic_file_aio_write() -> __alloc_pages() -> ...
Well, but ext3_file_write() doesn't exist either so the comment obviously
needs further updates.

> *
> * Same applies to ext3_get_block(). We will deadlock on various things like
> * lock_journal and i_truncate_mutex.
> @@ -3212,7 +3212,7 @@ out_brelse:
> *
> * We are called from a few places:
> *
> - * - Within generic_file_write() for O_SYNC files.
> + * - Within generic_file_aio_write() for O_SYNC files.
> * Here, there will be no transaction running. We wait for any running
> * transaction to commit.
> *
This is correct but as I'm looking through the comment it needs much
larger update. So something like attached patches looks more appropriate.
Thanks for pointing me to those outdated comments.

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR


Attachments:
(No filename) (1.47 kB)
0001-ext3-Update-PF_MEMALLOC-handling-in-ext3_write_inode.patch (2.55 kB)
0002-ext3-Update-outdated-comment-before-ext3_ordered_wri.patch (3.42 kB)
Download all attachments

2014-03-03 01:44:27

by Zhang Zhen

[permalink] [raw]
Subject: Re: [PATCH] ext3: fix some wrong comments

On 2014/2/28 16:37, Jan Kara wrote:
> On Fri 28-02-14 15:28:59, ZhangZhen wrote:
>> The comments in the code are wrong, because every generic_file_write()
>> is replaced by generic_file_aio_write().
>>
>> Signed-off-by: Zhang Zhen <[email protected]>
>> ---
>> fs/ext3/inode.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
>> index 384b6eb..0b94832 100644
>> --- a/fs/ext3/inode.c
>> +++ b/fs/ext3/inode.c
>> @@ -1574,7 +1574,7 @@ static int buffer_unmapped(handle_t *handle, struct buffer_head *bh)
>> *
>> * Similar for:
>> *
>> - * ext3_file_write() -> generic_file_write() -> __alloc_pages() -> ...
>> + * ext3_file_write() -> generic_file_aio_write() -> __alloc_pages() -> ...
> Well, but ext3_file_write() doesn't exist either so the comment obviously
> needs further updates.
>
>> *
>> * Same applies to ext3_get_block(). We will deadlock on various things like
>> * lock_journal and i_truncate_mutex.
>> @@ -3212,7 +3212,7 @@ out_brelse:
>> *
>> * We are called from a few places:
>> *
>> - * - Within generic_file_write() for O_SYNC files.
>> + * - Within generic_file_aio_write() for O_SYNC files.
>> * Here, there will be no transaction running. We wait for any running
>> * transaction to commit.
>> *
> This is correct but as I'm looking through the comment it needs much
> larger update. So something like attached patches looks more appropriate.
> Thanks for pointing me to those outdated comments.
>
> Honza
>
Hi Honza,

Your fix is more better than mine. It's a good chance for me to learn, thanks!

Zhen