Re: [PATCH] btrfs: Return EBUSY in case btrfs_start_write_no_snapshotting fails

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

 



On Tue, Apr 23, 2019 at 04:59:36PM +0300, Nikolay Borisov wrote:
> 
> 
> On 23.04.19 г. 14:48 ч., Nikolay Borisov wrote:
> > If btrfs_start_write_no_snapshotting fails (returns 0) it means there
> > is snapshot in progress hence resource is busy and not that we are
> > out of space. Change the return value to correctly reflect this.
> > 
> > Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>
> > ---
> >  fs/btrfs/file.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> > index 2030b9bcb977..ce1dec51ff92 100644
> > --- a/fs/btrfs/file.c
> > +++ b/fs/btrfs/file.c
> > @@ -1547,7 +1547,7 @@ static noinline int check_can_nocow(struct btrfs_inode *inode, loff_t pos,
> >  
> >  	ret = btrfs_start_write_no_snapshotting(root);
> >  	if (!ret)
> > -		return -ENOSPC;
> > +		return -EBUSY;
> 
> This error is not returned to userspace, nevertheless write won't expect
> EBUSY in case it ever is. Perhaps EAGAIN makes more sense?

Yeah, EAGAIN sounds better.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux