diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8e604e7071f14cf166652369e6f167fab5b5f462..d82afca0c05f092f51b89eb4c69207e92106fb60 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9124,7 +9124,8 @@ static int btrfs_truncate(struct inode *inode, bool skip_writeback) BTRFS_EXTENT_DATA_KEY); trans->block_rsv = &fs_info->trans_block_rsv; if (ret != -ENOSPC && ret != -EAGAIN) { - err = ret; + if (ret < 0) + err = ret; break; }