From: Vyacheslav Dubeyko <slava@dubeyko.com>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>,
Al Viro <viro@zeniv.linux.org.uk>,
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
Christoph Hellwig <hch@lst.de>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH 1/2] hfsplus: add error propagation to __hfsplus_ext_write_extent()
Date: Mon, 08 Apr 2013 09:55:26 +0400 [thread overview]
Message-ID: <1365400526.2673.3.camel@slavad-ubuntu> (raw)
In-Reply-To: <1365369695-8340-1-git-send-email-khoroshilov@ispras.ru>
Hi Alexey,
On Mon, 2013-04-08 at 01:21 +0400, Alexey Khoroshilov wrote:
> __hfsplus_ext_write_extent() suppresses errors coming from hfs_brec_find().
> The patch implements error code propagation.
>
Please, prepare a single patch set for all your changes in HFS and HFS+. These changes are related to each other, so, it makes sense in one patch set.
Thanks,
Vyacheslav Dubeyko.
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> fs/hfsplus/extents.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
> index a94f0f7..fed73f7 100644
> --- a/fs/hfsplus/extents.c
> +++ b/fs/hfsplus/extents.c
> @@ -83,7 +83,7 @@ static u32 hfsplus_ext_lastblock(struct hfsplus_extent *ext)
> return be32_to_cpu(ext->start_block) + be32_to_cpu(ext->block_count);
> }
>
> -static void __hfsplus_ext_write_extent(struct inode *inode,
> +static int __hfsplus_ext_write_extent(struct inode *inode,
> struct hfs_find_data *fd)
> {
> struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
> @@ -98,13 +98,13 @@ static void __hfsplus_ext_write_extent(struct inode *inode,
> res = hfs_brec_find(fd, hfs_find_rec_by_key);
> if (hip->extent_state & HFSPLUS_EXT_NEW) {
> if (res != -ENOENT)
> - return;
> + return res;
> hfs_brec_insert(fd, hip->cached_extents,
> sizeof(hfsplus_extent_rec));
> hip->extent_state &= ~(HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW);
> } else {
> if (res)
> - return;
> + return res;
> hfs_bnode_write(fd->bnode, hip->cached_extents,
> fd->entryoffset, fd->entrylength);
> hip->extent_state &= ~HFSPLUS_EXT_DIRTY;
> @@ -117,11 +117,13 @@ static void __hfsplus_ext_write_extent(struct inode *inode,
> * to explicily mark the inode dirty, too.
> */
> set_bit(HFSPLUS_I_EXT_DIRTY, &hip->flags);
> +
> + return 0;
> }
>
> static int hfsplus_ext_write_extent_locked(struct inode *inode)
> {
> - int res;
> + int res = 0;
>
> if (HFSPLUS_I(inode)->extent_state & HFSPLUS_EXT_DIRTY) {
> struct hfs_find_data fd;
> @@ -129,10 +131,10 @@ static int hfsplus_ext_write_extent_locked(struct inode *inode)
> res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->ext_tree, &fd);
> if (res)
> return res;
> - __hfsplus_ext_write_extent(inode, &fd);
> + res = __hfsplus_ext_write_extent(inode, &fd);
> hfs_find_exit(&fd);
> }
> - return 0;
> + return res;
> }
>
> int hfsplus_ext_write_extent(struct inode *inode)
> @@ -175,8 +177,11 @@ static inline int __hfsplus_ext_cache_extent(struct hfs_find_data *fd,
>
> WARN_ON(!mutex_is_locked(&hip->extents_lock));
>
> - if (hip->extent_state & HFSPLUS_EXT_DIRTY)
> - __hfsplus_ext_write_extent(inode, fd);
> + if (hip->extent_state & HFSPLUS_EXT_DIRTY) {
> + res = __hfsplus_ext_write_extent(inode, fd);
> + if (res)
> + return res;
> + }
>
> res = __hfsplus_ext_read_extent(fd, hip->cached_extents, inode->i_ino,
> block, HFSPLUS_IS_RSRC(inode) ?
next prev parent reply other threads:[~2013-04-08 5:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-29 21:44 [PATCH] hfs: add error checking for hfs_find_init() Alexey Khoroshilov
2013-03-30 11:35 ` Vyacheslav Dubeyko
2013-03-30 14:01 ` Hin-Tak Leung
2013-04-06 21:13 ` Alexey Khoroshilov
2013-04-07 9:31 ` Vyacheslav Dubeyko
2013-04-07 21:21 ` [PATCH 1/2] hfsplus: add error propagation to __hfsplus_ext_write_extent() Alexey Khoroshilov
2013-04-07 21:21 ` [PATCH 2/2] hfsplus: add printk to log allocation failure in hfs_find_init() Alexey Khoroshilov
2013-04-07 22:00 ` Joe Perches
2013-04-08 6:08 ` Vyacheslav Dubeyko
2013-04-08 16:37 ` [PATCH 0/2] hfs/hfsplus: Modernize logging styles Joe Perches
2013-04-08 16:37 ` [PATCH 1/2] hfs/hfsplus: Convert dprint to hfs_dbg Joe Perches
2013-04-09 7:08 ` Vyacheslav Dubeyko
2013-04-15 0:53 ` Hin-Tak Leung
2013-04-15 1:51 ` Joe Perches
2013-04-15 1:56 ` Hin-Tak Leung
2013-04-15 2:06 ` Joe Perches
2013-04-15 3:46 ` Hin-Tak Leung
2013-04-15 4:00 ` Joe Perches
2013-04-15 4:22 ` Hin-Tak Leung
2013-04-15 4:38 ` Joe Perches
2013-04-08 16:37 ` [PATCH 2/2] hfs/hfsplus: Convert printks to pr_<level> Joe Perches
2013-04-09 7:08 ` Vyacheslav Dubeyko
2013-04-09 7:08 ` [PATCH 0/2] hfs/hfsplus: Modernize logging styles Vyacheslav Dubeyko
2013-04-09 10:39 ` Joe Perches
2013-04-09 11:06 ` Vyacheslav Dubeyko
2013-04-08 5:55 ` Vyacheslav Dubeyko [this message]
2013-04-09 18:14 ` [PATCH 1/2] hfs: add error checking for hfs_find_init() Alexey Khoroshilov
2013-04-09 18:14 ` [PATCH 2/2] hfsplus: add error propagation to __hfsplus_ext_write_extent() Alexey Khoroshilov
2013-04-10 6:40 ` Vyacheslav Dubeyko
2013-04-10 6:40 ` [PATCH 1/2] hfs: add error checking for hfs_find_init() Vyacheslav Dubeyko
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=1365400526.2673.3.camel@slavad-ubuntu \
--to=slava@dubeyko.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=hch@lst.de \
--cc=htl10@users.sourceforge.net \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--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;
as well as URLs for NNTP newsgroup(s).