RE: [f2fs-dev] [PATCH 2/2] f2fs: handle error cases in commit_inmem_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@xxxxxxxxxx]
> Sent: Tuesday, July 28, 2015 11:57 PM
> To: Chao Yu
> Cc: linux-kernel@xxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx;
> linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: handle error cases in commit_inmem_pages
> 
> On Tue, Jul 28, 2015 at 06:25:26PM +0800, Chao Yu wrote:
> > Hi Jaegeuk,
> >
> > > -----Original Message-----
> > > From: Jaegeuk Kim [mailto:jaegeuk@xxxxxxxxxx]
> > > Sent: Sunday, July 26, 2015 8:21 AM
> > > To: linux-kernel@xxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx;
> > > linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx
> > > Cc: Jaegeuk Kim
> > > Subject: [f2fs-dev] [PATCH 2/2] f2fs: handle error cases in commit_inmem_pages
> > >
> > > This patch adds to handle error cases in commit_inmem_pages.
> > > If an error occurs, it stops to write the pages and return the error right
> > > away.
> > >
> > > Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
> > > ---
> > >  fs/f2fs/f2fs.h    |  2 +-
> > >  fs/f2fs/file.c    |  6 ++++--
> > >  fs/f2fs/segment.c | 10 ++++++++--
> > >  3 files changed, 13 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > > index e73f2e2..58b05b5 100644
> > > --- a/fs/f2fs/f2fs.h
> > > +++ b/fs/f2fs/f2fs.h
> > > @@ -1697,7 +1697,7 @@ void destroy_node_manager_caches(void);
> > >   * segment.c
> > >   */
> > >  void register_inmem_page(struct inode *, struct page *);
> > > -void commit_inmem_pages(struct inode *, bool);
> > > +int commit_inmem_pages(struct inode *, bool);
> > >  void f2fs_balance_fs(struct f2fs_sb_info *);
> > >  void f2fs_balance_fs_bg(struct f2fs_sb_info *);
> > >  int f2fs_issue_flush(struct f2fs_sb_info *);
> > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> > > index 25d1a2f..a2b3656 100644
> > > --- a/fs/f2fs/file.c
> > > +++ b/fs/f2fs/file.c
> > > @@ -1358,7 +1358,9 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp)
> > >
> > >  	if (f2fs_is_atomic_file(inode)) {
> > >  		clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
> > > -		commit_inmem_pages(inode, false);
> > > +		ret = commit_inmem_pages(inode, false);
> > > +		if (ret)
> > > +			return ret;

It looks we forget to call mnt_drop_write_file before return.

[snip]

> This entry is not removed from the list.
> So, after failure, the abort path will put the page and remove it from the list.

Oh, you're right, thanks for your explanation! :)

Thanks,


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux