lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 04 Apr 2013 09:14:55 +0900
From:	Jaegeuk Kim <jaegeuk.kim@...sung.com>
To:	P J P <ppandit@...hat.com>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Petr Matousek <pmatouse@...hat.com>
Subject: Re: [PATCH] To add NULL pointer check

Hi,

2013-04-03 (수), 14:43 +0530, P J P:
> +-- On Wed, 3 Apr 2013, Jaegeuk Kim wrote --+
> | I'm confusing the question because f2fs doesn't use generic_writepages(), 
> | since f2fs_write_data_pages() is linked to a_ops->writepages. In 
> | do_writepages(), always f2fs_write_data_pages() is triggered instead of 
> | generic_writepages(). Isn't it?
> 
> Before commit fa9150a84c, when `generic_writepages' returned 0, it did not 
> abort `f2fs_write_data_pages', as the proposed patch does. I was wondering if 
> that's intentional OR if the patch below does it right?
> 
> ===
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 7bd22a2..7be750e 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -561,7 +561,7 @@ static int f2fs_write_data_pages(struct address_space 
> *mapping,
>  {
>         struct inode *inode = mapping->host;
>         struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
> -       int ret;
> +       int ret = 0;
>         long excess_nrtw = 0, desired_nrtw;
>  
>         if (wbc->nr_to_write < MAX_DESIRED_PAGES_WP) {
> @@ -572,7 +572,9 @@ static int f2fs_write_data_pages(struct address_space *mapping,
>  
>         if (!S_ISDIR(inode->i_mode))
>                 mutex_lock(&sbi->writepages);
> -       ret = write_cache_pages(mapping, wbc, __f2fs_writepage, mapping);
> +       /* deal with chardevs and other special file */
> +       if (mapping->a_ops->writepage)
> +               ret = write_cache_pages(mapping, wbc, __f2fs_writepage, mapping);

Why should we take unnecessary locks and an f2fs_submit_bio call?
Thanks,

>         if (!S_ISDIR(inode->i_mode))
>                 mutex_unlock(&sbi->writepages);
>         f2fs_submit_bio(sbi, DATA, (wbc->sync_mode == WB_SYNC_ALL));
> ===
> 
> Thank you.
> --
> Prasad J Pandit / Red Hat Security Response Team
> DB7A 84C5 D3F9 7CD1 B5EB  C939 D048 7860 3655 602B
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Jaegeuk Kim
Samsung

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ